Ejemplo n.º 1
0
 /**
  * Enter description here...
  *
  * @return bool
  */
 public function delete()
 {
     if (count($this->getPresentsList()) > 0) {
         throw new RM_Base_Exception_BadUsage(__METHOD__ . ': you want delete not empty category');
     }
     return parent::delete();
 }
Ejemplo n.º 2
0
 public function delete()
 {
     if ($this->_mapper->canDeleteTradeCenter($this)) {
         parent::delete();
     } else {
         throw new Exception("Unable to delete tradeCenter " . $this->name . " due shops linked to it.");
     }
 }
Ejemplo n.º 3
0
 public function delete()
 {
     if (!$this->canDelete()) {
         $res = M('Base')->result();
         $res->error('family_is_not_empty');
         throw new RM_Validator_Exception($res);
     }
     parent::delete();
 }
Ejemplo n.º 4
0
 public function delete()
 {
     if ($this->_mapper->shopTypeDeleteCheck($this)) {
         $this->_mapper->deleteSettings('type', $this->id());
         parent::delete();
     } else {
         throw new Exception("Unable to delete shop type `" . $this->name . "' due shops linked to it.");
     }
 }
Ejemplo n.º 5
0
 public function delete()
 {
     if (!$this->_mapper->canDeleteCatalogueEntry($this)) {
         $res = M('Base')->result();
         $res->error('have_childs');
         throw new RM_Validator_Exception($res);
     }
     parent::delete();
 }
Ejemplo n.º 6
0
 public function delete()
 {
     if (($this->city_id != me()->city_id || !$this->city_id) && !me()->isUserInGroup('federal-news')) {
         $this->_permissionDenied();
     }
     if ($this->city_id == me()->city_id && !me()->isUserInGroup('regional-news')) {
         $this->_permissionDenied();
     }
     parent::delete();
 }
Ejemplo n.º 7
0
 /**
  *	Delete mail & all related objects.
  *
  *    @return        bool     true    - success 
  *                            false   - failed (use $ob->validator()->getErrors() method to get errors)
  */
 public function delete()
 {
     $rs = $this->getAttachmentList();
     if (!parent::delete()) {
         return false;
     }
     foreach ($rs as $ob) {
         $ob->delete();
     }
     return true;
 }
Ejemplo n.º 8
0
 /**
  * @see RM_Store_Object::delete
  */
 public function delete()
 {
     if (count($this->_mapper->getCompositeListForScript($this)) > 0) {
         throw new RM_Validator_Exception(M('Base')->error('has_depended_composite'));
     }
     parent::delete();
     if (!isNull($this->_map)) {
         $this->_mapper->deleteMap($this);
     }
     return TRUE;
 }
Ejemplo n.º 9
0
 public function delete()
 {
     if ($this->_mapper->hasDependency($this)) {
         return FALSE;
     }
     foreach ($this->_mapper->getDependedList($this)->sort('cdate', 'desc')->sort('pos') as $object) {
         $this->_mapper->removeDependency($this, $object);
         $object->delete();
     }
     $this->_mapper->clearStack($this->id());
     parent::delete();
     return TRUE;
 }
Ejemplo n.º 10
0
 /**
  *	Deletes leave (удалить отпуск).
  *
  *	@return		bool
  */
 public function delete()
 {
     /*		if ( !$this->canDelete() )
     			return FALSE;*/
     $this->_mapper->resetDaysByLeave($this);
     return parent::delete();
 }
Ejemplo n.º 11
0
 /**
  * Deletes this object
  *
  * @return bool
  **/
 public function delete()
 {
     // нельзя удалить, если объект в стоплисте
     if ($this->stoplist == 1) {
         return FALSE;
     }
     // нельзя удалить, если привязаны штрих-коды
     // You cannot delete object because there are barcodes linked with this entity
     if (count($this->getBarcodes()) > 0) {
         $res = new RM_Base_Result();
         $res->error('has_barcode');
         throw new RM_Validator_Exception($res);
     }
     return parent::delete();
 }
Ejemplo n.º 12
0
 /**
  *	Delete type & all related objects.
  *
  *    @return        bool     true    - success
  *                            false   - failed (use $ob->validator()->getErrors() method to get errors)
  */
 public function delete()
 {
     $rs1 = $this->getTemplateList();
     $rs2 = $this->getVariableList();
     if (!parent::delete()) {
         return false;
     }
     // delete templates
     foreach ($rs1 as $ob) {
         $ob->delete();
     }
     // delete variables
     foreach ($rs2 as $ob) {
         $ob->delete();
     }
     return true;
 }
Ejemplo n.º 13
0
 public function delete()
 {
     if ($this->_mapper->hasActiveLinks($this) && trim($this->name) != 'Введите название') {
         $result = M('Base')->result();
         $result->error('has_active_links');
         throw new RM_Validator_Exception($result);
     }
     foreach ($this->receipts() as $obReceipt) {
         $obReceipt->delete();
     }
     $this->_mapper->removeAssortiment($this);
     $this->_mapper->removeLinks($this);
     return parent::delete();
 }
Ejemplo n.º 14
0
 /**
  * Deletes this object
  *
  * @return	bool
  **/
 public function delete()
 {
     if (parent::delete()) {
         $this->clearResultSteps();
         return TRUE;
     }
     return FALSE;
 }
Ejemplo n.º 15
0
 public function undo()
 {
     return parent::delete();
 }
Ejemplo n.º 16
0
 public function delete()
 {
     $this->getRootDir()->delete();
     parent::delete();
 }
Ejemplo n.º 17
0
 /**
  * Deletes this object
  *
  * @return	bool
  **/
 public function delete()
 {
     $this->clearResultAnswers();
     return parent::delete();
 }
Ejemplo n.º 18
0
 /**
  * Deletes this object
  *
  * @return	bool
  **/
 public function delete()
 {
     $this->_canDelete();
     return parent::delete();
 }
Ejemplo n.º 19
0
 /**
  * Enter description here...
  *
  * @return void
  */
 public function delete()
 {
     if (!$this->canDelete()) {
         throw new RM_Base_Exception_BadUsage(__METHOD__ . ' you can\'t delete this order. Please use `canDelete()` method to check ');
     }
     M('Points')->deletePresentOrder(array('user_id' => $this->user_id, 'present_id' => $this->present_id, 'price' => $this->getPresent()->price, 'quantity' => $this->quantity));
     foreach ($this->_items as $obOrderItem) {
         $obOrderItem->delete();
     }
     return parent::delete();
 }