jpfuentes2/php-activerecord — pull request #376 by koenpunt (2013-11-11 22:43:27+00:00)
Title: ArrayObject relations

This is updated version of @greut's PR #108, which fixes #49.

His original description below:

---

A relation returns an object instead of an Array that enables better usage of `count`.

```php
$host->venues // does nothing
count($host->venues) // select count(*) … where $host_id = ?
$host->venues[0] // select … inner join …
```

It could even lead to some improvements, feature wise:

```php
$venues = $host->venues(array('is_active' => true));
count($venues) // select count(*) … where $host_id = ? and is_active = 1
$venues[0] // select … inner join … where is_active = 1
```

This still need to be done, but I'd like to see something like that implemented.