Hi i'm using zend framework and I have a problem on delete cascade.
I have two entity in Zend db table called User and other two (because i have 2 tipe of users) connected to User
User is
class Application_Model_DbTable_User extends Zend_Db_Table_Abstract
{
protected $_name = 'user';
protected $_primary = 'username';
protected $_dependentTables = array('Cliente','Trainer');
}
One of the other is
class Application_Model_DbTable_Trainer extends Zend_Db_Table_Abstract{
protected $_name = 'trainer';
protected $_primary = 'idusername';
protected $_referenceMap = array(
'Utente' => array(
'columns' => array('idusername'),
'refTableClass' => 'user',
'refColumns' => array('username'),
'onDelete' => self::CASCADE
)
);
protected $_dependentTables = array('Trainermaster','Presenza','Uscita');}
When I use the delete option on an object of User, Zend delete only the user in the User table and not in Trainer table...
I have set the delete cascade in mysql database too to be more safe but it doesn't work.