CakePhp: model recursive associations and find
- by Petecocoon
Hello to everybody!
I've some trouble with a find() on a model on CakePhp.
I have three model relationed in this way:
Project(some_fields, item_id)
------belongsTo----- Item(some_fields, item_id)
------belongsTo----- User(some_fields campi, nickname)
I need to do a find() and retrieve all fields from project, a field from Item and the nickname field from User. This is my code:
$this->set('projects', $this->Project->find('all', array('recursive' => 2)));
but my output doesn't contains the user object.
I've tried with Containable behaviour but the output is the same. What is broken?
Many many Thanks
Peter