developerforce/Force.com-Toolkit-for-PHP — pull request #15 by MidnightLightning (2012-05-24 18:52:22+00:00)
Title: Make QueryResult and sObject objects smarter

Added the [Iterator interface](http://us2.php.net/manual/en/class.iterator.php) to the QueryResult object, which allows users to go:

```php
$rs = $sf->query('SELECT Id, Name FROM Lead');
foreach($rs as $lead) {
print_r($lead); // sObject
}
```

QueryResult also calls the `queryMore()` function automatically as it reaches the end of its own result list, if there's more to be fetched.

Also added the `__get()` and `__isset()` [overload](http://us2.php.net/manual/en/language.oop5.overloading.php#object.get) methods to the `sObject` class to not require people to delve into the "fields" property:

```php
// Instead of:
$foo = $sObj->fields->Foo__c;

// Just do:
$foo = $sObj->Foo__c;
```