_db->select(); $select->from($this->_getPair('Leadership'), 'id'); $select->where('`Leadership`.`categoryId` = ?', $this->getPrimaryKey(), Zend_Db::INT_TYPE); $select->limit(1); return (bool) $this->_db->fetchOne($select); } public function delete() { $this->_clearErrors(); if (null === $this->getData()) { $this->_addError(static::MSG_INVALID_RECORD_ID); return false; } else if ($this->hasPersons()) { $this->_addError(static::MSG_HAS_PERSONS); return false; } $this->_deleteDependency(); $this->_deleteFiles(); return $this->_getTable()->deleteByKey($this->_primaryKey); } }