I've been building an application that includes an application which
includes the model shown below:
App::uses('AppModel', 'Model');
class EntityFunction extends AppModel {
public $name = 'EntityFunction';
public $displayField = 'title';
public $validate = array(
'title' => array(
'rule' => 'isUnique',
'message' => 'This function title has already been used.'
)
);
public $actsAs = array('Tree');
public $hasMany = array(
'ChildEntityFunctions' => array(
'className' =>'EntityFunction',
'foreignKey' =>'parent_id',
'dependent' => true
)
);
public $belongsTo = array(
'ParentEntityFunction' => array(
'className' => 'EntityFunction',
'foreignKey' => 'parent_id'
)
);
}
When using *public $scaffold; *in the corresponding controller the CRUD
interface for the model works fine. However when it comes to baking the
controller and views the *Parent* is blank, and saving creates a new table
row with the *parent_id* of null.
Am I missing something here? Or is this just a problem with baking trees...
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.