The PHPR AR is pretty solid, except it doesn't support eager loading.
Syntax would be like this:
User::create()->find_all(null, array('friends'));
Resulting in a grouped SQL statement to populate the "friends" relationship
SELECT * FROM user_friends WHERE id IN (1, 2, 3, 4, 5)
The result is a collection of eager assosiated that can be used when $user->friends is called. At the moment the code would produce:
SELECT * FROM user_friends WHERE id = 1;
SELECT * FROM user_friends WHERE id = 2;
SELECT * FROM user_friends WHERE id = 3;
SELECT * FROM user_friends WHERE id = 4;
SELECT * FROM user_friends WHERE id = 5;
The PHPR AR is pretty solid, except it doesn't support eager loading.
Syntax would be like this:
Resulting in a grouped SQL statement to populate the "friends" relationship
The result is a collection of eager assosiated that can be used when
$user->friends
is called. At the moment the code would produce:^ Yuck!