I have HABTM associations between two models but can only get find to return one level. I can return several levels with other associations but think I must be missing something with HABTM.
Controller/SchedulesController.php
$this->Schedule->find('first', array(
'contain' => array(
'Association' => array(
'Schedule'
)
)
));
Model/Schedule.php
public $actsAs = array('Containable');
public $hasAndBelongToMany = array(
'Association'
);
Model/Association.php
public $actsAs = array('Containable');
public $hasAndBelongsToMany = array(
'Schedule'
);
At the moment I only get...
array(
'Schedule' => array(
...
),
'Association' => array(
(int) 0 => array(
...
'AssociationsSchedule' => array(
...
)
)
)
...but I would like Schedule -> Association -> Schedule