Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    I'm pulling out my hair over this one...

    I've got the following PHP code:
    PHP Code:
    print_r($element->getName()); 
    Which raises this exception:
    Code:
    Fatal error:  Call to a member function getName() on a non-object in /home/madison/public_html/daemons/import_raw.php on line 44
    But when I change the same line of code to this:
    PHP Code:
    print_r($element); 
    I get this output:
    Code:
    DataElement Object
    (
        [id:private] => 59
        [dataFileId:private] => 2
        [dataTypeId:private] => 2
        [dataConversionHandlerId:private] => 1
        [name:private] => FOLIO-KEY
        [position:private] => 
        [length:private] => 15
        [start:private] => 1
        [end:private] => 15
        [paddingTypeId:private] => 2
    )
    WTF?!?! Is there a way of specifically casting something? I mean, it looks like the object is not serialized, and is specifically cast as a DataElement, which has the method getName() Any PHP gurus who can help out with this?

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    nevermind, fixed it.

  4. #3
    Senior Member -chris-'s Avatar
    Join Date
    Apr 2006
    Location
    SK
    Posts
    1,205
    Member #
    13102
    How?
    Portfolio | Blog | Twitter

    Was my post, or someone elses, helpful? Click the thumbs up to let everyone know!

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Presumably, the error originated within the actual getName() method and not the print_r() call.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:39 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com