CakePHP containable how to do a recursion with join? -
i want retrieve tree nodes recursively , want join each [node] [level]
node:
... public $belongsto = array( 'parent' => array( 'classname' => 'node', 'foreignkey' => 'parent_id' ), 'level' => array( 'classname' => 'level', 'foreignkey' => 'level_id' ) ); ...
controller:
$this->node->contain(array( 'parent.parent.parent.parent.parent', )); $parenttree = $this->node->findallbyid($id);
the recursion works want each node have level element , it's not case.
how correct contain parameter?
levels recursive in case want restrict recursion - need first one
Comments
Post a Comment