_messageTemplates[self::MSG_WRONG_DELETE] = 'You can delete the last record only'; return parent::_init(); } protected function _doDelete() { $lastPrice = $this->_getDataObj()->getNeighborPrice(null, App_ECommerce_ShippingPrice_Admin_Obj::PREVIOUS_DIRECTION); if ($lastPrice['id'] == $this->_getDataObj()->getPrimaryKey()) { parent::_doDelete(); } $this->_setBackError(static::MSG_WRONG_DELETE); $this->_doBack(); } protected function _postUpdate() { $this->_getDataObj()->updateNeighbors(); return parent::_postUpdate(); } protected function _postInsert() { $this->_getDataObj()->updateNeighbors(); return parent::_postInsert(); } }