开发者

One-to-many relationship in the same table in zend

开发者 https://www.devze.com 2022-12-29 18:57 出处:网络
I have groupTable(group_id,group_name,group_date,group_parent_id) in face each group have many group child.

I have groupTable(group_id,group_name,group_date,group_parent_id)

in face each group have many group child. I create groupModel and I want to begin coding is this right code to handle?

protected $_name = 'group';   
protected $_dependentTables = array('Model_group');  
protected $_referenceMap = array('Model_group' =>   
    array('columns' => array('group_parent_id') ,   
    'refTableClass' => 'Model_group' ,   
    'refColu开发者_如何学Cmns' => array('group_id') ,   
    'onDelete' => self::CASCADE ,   
    'onUpdate' => self::RESTRICT)  
);


One to many implies more than one table

0

精彩评论

暂无评论...
验证码 换一张
取 消