Just got a small issue - thought I would post it before I go ripping datamapper apart in case someone can quickly shed some light on my errors..
I have users in a M:M relationship with privileges
I can do this,
Code:
$u = new User();
$u->get_by_id(99);
$p = $u->privileges->get(); // ->all contains all the correct privileges as expected
but I cannot do this
Code:
$p = new Privileges();
$p->get_by_name('staff');
$u = $p->user->get(); //Doesn't query the DB,
The relation is pretty straight forward, user table with id, privileges table with id, privileges_users table with user_id and privilege_id. The fact it works one way is kinda saying the data setup is correct, I've done a little debugging and get_by_name() is definitely getting a privilege with an id that is present in the relationship table.