AnsweredAssumed Answered

Referencing items in the relationship_list array

Question asked by Chuck Chuck on Mar 6, 2014
I am trying to reference items in the "[relationship_list] => array" in PHP.  I am very new to SugarCRM and fairly new at PHP.  I have been referencing the "[entry_list} => array" just fine, but now I need to get Team Member info for an Account.

Here is a snippet of the output I get when using print_r.
stdClass Object
(
    [result_count] => 10      [total_count] => -1      [next_offset] => 10      [entry_list] => Array          (              [0] => stdClass Object                  (                      [id] => 1                      [module_name] => TeamSets                      [name_value_list] => stdClass Object                          (                              [id] => stdClass Object                                  (                                      [name] => id                                      [value] => 1                                  )                            )                    )

then, further down...

[relationship_list] => Array
        (
            [0] => stdClass Object
                (
                    [link_list] => Array
                        (
                            [0] => stdClass Object
                                (
                                    [name] => teams
                                    [records] => Array
                                        (
                                            [0] => stdClass Object
                                                (
                                                    [link_value] => stdClass Object
                                                        (
                                                            [id] => stdClass Object
                                                                (
                                                                    [name] => id
                                                                    [value] => 1
                                                                )                                                              [name] => stdClass Object
                                                                (
                                                                    [name] => name
                                                                    [value] => Global
                                                                )                                                          )                                                  )                                          )                                  )                          )                  )
 
I am trying to retrieve the the "[value] => Global" in PHP, but I'm not sure how to do it.  I'm sure it is a simple issue (hopefully) for someone who knows what they are doing.

This is what I have been doing in the past for the 'get_entry_list':

$get_entry_list_result = call('get_entry_list', $get_entry_list_parameters, $url);
echo '<pre>';
print_r($get_entry_list_result);
echo '</pre>';
foreach ($get_entry_list_result->entry_list as $entryList) {
foreach($entryList as $item) {
        $ownerID = $item->id->value;
echo "Owner ID: " . $ownerID . "<br/>";
        $ownerName = $item->name->value;
echo "Owner Name: " . $ownerName . "<br/>";
     I don't see a 'get_relationship_list' for the "[relationship_list] => array"...

Any help would be GREATLY appreciated.

Thanks,
Chuck

Outcomes