SkyPHP/skyphp — pull request #71 by stanistan (2012-06-08 19:36:37+00:00)
Title: Model loading tweak

Instead of only using `$model->_properties` stored in cache with the object, when a model making sure the sub objects are not outdated, it uses the currently defined model's AQL statement.

This cuts down on data compatibility issues when a model has changed (a field is added or removed) and a method is added that uses this field.

---

This is one step in the direction of *NOT* storing object metadata in the cache (only `$model->_data`, `$model->_cached_time`) and greatly decreasing the size, and lazy loading our information.

## Example:

#### Old AQL:

```
artist {
name
}
```

#### New AQL:

```
artist {
name,
[artist_album]s as albums
}
```

#### Behavior:

```php
mapSubObjects('albums', $callback);

# new behavior, this property is added as it is created
# (although the data would still eventually have to be refreshed)