Is it possible to access more than one model in the relationship between lithiums?
For example, I have a User model:
class Users extends \lithium\data\Model { public $validates = array(); public $belongsTo = array("City"); }
and I have a city model:
class Cities extends \lithium\data\Model { public $validates = array(); public $belongsTo = array("State"); }
state model etc.
If I ask a user with something similar to Users::first() , is it possible to get all the relationships included in the results? I know what I can do Users::first(array('with' => 'City')) , but I would like each City to return its state model, so I can access it like this:
$user->city->state->field
Right now, I can only get it to the depths ( $user->city ), and I will have to demand again, which seems ineffective.
source share