array('schoolName', 'name', 'email')); protected function _deleteDependency() { $this->_deleteDocuments(); return parent::_deleteDependency(); } protected function _deleteDocuments() { $select = $this->_db->select(); $select->from(Qs_Db::getPair('ApplicationDocument'), array('id')); $select->where('`applicationUserId` = ?', $this->getPrimaryKey()); $ids = $this->_db->fetchCol($select); if (!empty($ids)) { $obj = new App_Application_Document_AdminObj(); $obj->setApplicationUserId($this->getPrimaryKey()); $obj->setUserType(App_Application_Document_Obj::USER_TYPE_APPLICANT); foreach ($ids as $id) { $obj->setPrimaryKey($id); $obj->delete(); } } return $this; } }