+ Reply to Thread
Results 1 to 3 of 3

Thread: Error with stdClass->$types

  1. #1
    Bugorr is offline Junior Member
    Join Date
    Nov 2009
    Posts
    3

    Error with stdClass->$types

    Hi,

    I'm implementing Salesforce PHP MySQL Database Replication Tool

    Everything seems to go OK until Objects (Tables) are going through the fields.

    $result = $client->describeGlobal();
    foreach ($result->types as $objectType)

    I'm getting this error:
    Notice: Undefined property: stdClass::$types in C:\Development\http1\repo\salesforce\php\accounts. html on line 52

    Warning: Invalid argument supplied for foreach() in C:\Development\http1\repo\salesforce\php\accounts. html on line 52

    I've looked at results returned by describeGlobal and types are not specified, so instead of types I've used sobjects as specified in result,
    that allows my to bypass above error but then I'm not able to get results from describeSObject.
    output from describeGlobal
    stdClass Object
    (
    [encoding] => UTF-8
    [maxBatchSize] => 200
    [sobjects] => ArrayAm I doing something wrong?

    Thanks,

    V.

  2. #2
    mike's Avatar
    mike is offline Administrator
    Join Date
    May 2007
    Location
    Wylie, Texas
    Posts
    557
    Blog Entries
    15
    V,

    Can I see more of your code? You can PM me with it if you do not want to post it in the open

    ~Mike

  3. #3
    phpandsfdc is offline Junior Member
    Join Date
    Jun 2009
    Posts
    5
    change

    Code:
    foreach ($result->types as $objectType)
    to

    Code:
    foreach($result->sobjects as $obj) {
      echo $obj->name . "\n";  // e.g. 'Account'
    }
    Last edited by phpandsfdc; 12-05-2009 at 02:38 PM.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO 3.5.1