[eluser]sqwk[/eluser]
I've got a bit of trouble with relationships:
Code:
$b = new Buyer();
$b->order_by('updated', 'desc')->get($limit, $offset);
$b->user->get();
$b->place->get();
$b->objtype->get();
Foreaching through $b works fine and I can echo all the fields from the buyers table, however, ALL of the relationship fields (like $buyer->user->username or $buyer->objtype->name) are empty. I checked that all the relationships are set up right in the models
All the fields from the joined tables are set, it is just that they are empty. Or am I accessing them wrong?
The other thing that I noticed is that all the queries from the joined tables seem to have an additional WHERE clause. (What are they for?)
Code:
WHERE `ksv_buyers`.`id` = 353
353 is the id of the first record that is being returned. The relationship fields are also not filled for this record.