/** * * Deletes this record from the database. * * @return void * */ public function delete() { if ($this->isNew()) { throw $this->_exception('ERR_CANNOT_DELETE_NEW_RECORD'); } if ($this->isDeleted()) { throw $this->_exception('ERR_DELETED'); } $this->_preDelete(); $primary = $this->getPrimaryCol(); $where = array("{$primary} = ?" => $this->getPrimaryVal()); $this->_model->delete($where); $this->_setSqlStatus(self::SQL_STATUS_DELETED); $this->_postDelete(); }