diff --git a/soapclient/SforceBaseClient.php b/soapclient/SforceBaseClient.php index 309162d..b3c8317 100644 --- a/soapclient/SforceBaseClient.php +++ b/soapclient/SforceBaseClient.php @@ -949,12 +949,10 @@ public function __construct($response) { if (isset($response->records)) { if (is_array($response->records)) { foreach ($response->records as $record) { - $sobject = new SObject($record); - array_push($this->records, $sobject); + array_push($this->records, $record); }; } else { - $sobject = new SObject($response->records); - array_push($this->records, $sobject); + array_push($this->records, $record); } } } @@ -966,7 +964,7 @@ public function setSf(SforceBaseClient $sf) { $this->sf = $sf; } // Dependency I public function rewind() { $this->pointer = 0; } public function next() { ++$this->pointer; } public function key() { return $this->pointer; } - public function current() { return $this->records[$this->pointer]; } + public function current() { return new SObject($this->records[$this->pointer]); } public function valid() { while ($this->pointer >= count($this->records)) {