我正在使用 Salesforce.com Toolkit for PHP,我正在尝试输出一些我认为非常简单的东西。
这是工作示例代码
$query = "SELECT ID, Phone FROM Contact LIMIT 5";
$response = $mySforceConnection->query($query);
foreach ($response->records as $record) {
echo $record->ID." - ".$record->Phone;
}
我已经调整了查询,现在只想输出名称和计数。但是下面的代码不起作用
$query = "SELECT owner.name, count(type) FROM Task LIMIT 5";
$response = $mySforceConnection->query($query);
foreach ($response->records as $record) {
echo $record->owner.name; //DOES NOT WORK
}
这就是我print_r ($record); 时得到的
stdClass Object ( [Id] => [any] => Array ( [0] => First Last [1] => 2177 ) )
我只想能够输出“First Last - 2177”