Ajout relation entre table
This commit is contained in:
parent
ee1320dc01
commit
4d8bd3b6d9
@ -3,7 +3,10 @@ class Application_Model_Commandes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes';
|
||||
|
||||
protected $_dependentTables = array('CommandesEven');
|
||||
protected $_dependentTables = array(
|
||||
'Application_Model_CommandesEven',
|
||||
'Application_Model_CommandesPieces',
|
||||
);
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
|
@ -6,8 +6,10 @@ class Application_Model_CommandesEven extends Zend_Db_Table_Abstract
|
||||
protected $_referenceMap = array(
|
||||
'CommandesEven' => array(
|
||||
'columns' => array('commande_id'),
|
||||
'refTableClass' => 'Commandes',
|
||||
'refColumns' => array('id'))
|
||||
'refTableClass' => 'Application_Model_Commandes',
|
||||
'refColumns' => array('id'),
|
||||
'onUpdate' => self::CASCADE
|
||||
),
|
||||
);
|
||||
|
||||
public function insert(array $data)
|
||||
@ -17,5 +19,4 @@ class Application_Model_CommandesEven extends Zend_Db_Table_Abstract
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
|
||||
}
|
@ -2,4 +2,13 @@
|
||||
class Application_Model_CommandesPieces extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_pieces';
|
||||
|
||||
protected $_referenceMap = array(
|
||||
'CommandesPieces' => array(
|
||||
'columns' => array('commande_id'),
|
||||
'refTableClass' => 'Application_Model_Commandes',
|
||||
'refColumns' => array('id'),
|
||||
'onUpdate' => self::CASCADE
|
||||
),
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user