Friday, April 27, 2012

Tree Behavior Issue

I want to use the Tree Behavior on one of my models in 2.1, but it has
multiple belongsTo relationships which I think is messing it up.

In my domain model I have added:

public $actAs = array('Tree');



In my controller I have:

public function index() {
$data = $this->Domain->generateTreeList(null, null, null, '   ');
debug($data); die;
}

It gives me a database error:

Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You
have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near
'generateTreeList' at line 1


I have also used $this->Domain->recover() and got the same message. Is
there some step I am missing? It didnt seem to be this difficult to do
in 1.3

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: