[eluser]tdktank59[/eluser]
Ok I must be going insane or something.
I think this used to work at least lol...
Ive got 2 tables
users and statuses
they have a many to one relation (each user can have a status)
On the user table there is the field status_id
I am trying to pull the status for the user like this
This one does not work I get the error
"DataMapper Error: 'User' is not a valid parent relationship for Status. Are your relationships configured correctly?"
Code:
$user = new User();
$user->get_by_id(1);
$user->status->get();
$user->status->name;
However going from the status it works...
Code:
$status = new Status();
$status->get_by_id(2);
$status->user->get();
foreach ($status->user as $user) {
print $user->username;
}
So just wondering whats going on, and want to make sure im not imagining things.
The models are setup properly
user: $has_one = array('status');
status: $has_many = array('user');