_db->select(); $select->from($this->_getPair('Faq'), 'id'); $select->where('`Faq`.`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->hasQuestions()) { $this->_addError(static::MSG_HAS_QUESTIONS); return false; } $this->_deleteDependency(); $this->_deleteFiles(); return $this->_getTable()->deleteByKey($this->_primaryKey); } }