getDataSource(); $dataSource->begin(); $result = $this->DreamjobPageInh->delete($id,$cascade); if($result){ $result = parent::delete($id,$cascade); } if ($result) { $dataSource->commit(); return true; } else { $dataSource->rollback(); } return false; } public $validate = array( 'page_ptr_id' => array( 'numeric' => array( 'rule' => array('numeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), 'multiple' => array( 'rule' => array('multiple'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), // 'text' => array(), ); //The Associations below have been created with all possible keys, those that are not needed can be removed /** * belongsTo associations * * @var array */ public $belongsTo = array( 'DreamjobPageInh' => array( 'className' => 'DreamjobPageInh', 'foreignKey' => 'page_ptr_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); }