One-to-many relationship in one table in zend

I have groupTable (group_id, group_name, group_date, group_parent_id)
on the face of each group has a lot of group child. I am creating a groupModel and I want to start coding, is this the correct 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' ,   
    'refColumns' => array('group_id') ,   
    'onDelete' => self::CASCADE ,   
    'onUpdate' => self::RESTRICT)  
);

      

+2


a source to share


1 answer


One to many means more than one table



-1


a source







All Articles