예제 #1
0
 /**
  *	Description...
  *
  *	@return void
  **/
 public function delete()
 {
     if (count($this->_mapper->getUsers()->filter('company_id=?', $this->id())) > 0) {
         throw new RM_Validator_Exception(M('Base')->error('has_clients'));
     }
     parent::delete();
 }
예제 #2
0
파일: User.class.php 프로젝트: evilgeny/bob
 public function delete()
 {
     $this->_mapper->memberDeleteAll($this);
     parent::delete();
 }
예제 #3
0
 /**
  * Deletes report object
  *
  * @return void
  **/
 public function delete()
 {
     // проверим права доступа на запись отчета
     $this->_mapper->access($this, 'DELETE');
     $result = parent::delete();
     if ($result) {
         $this->_mapper->_deleteCollection('hide', $this);
         $this->_mapper->_deleteCollection('group', $this);
         // delete related objects
         $this->removeAllDiagrams();
         $this->removeAllValues();
         $this->removeAllRestrictions();
         // delete related tables
         $table_name = $this->getTableName();
         M('Db')->setCurrentConnection('storage');
         foreach (M('Db')->query('SHOW TABLES LIKE ?', $table_name . '%') as $row) {
             M('Db')->exec('DROP TABLE IF EXISTS ' . array_pop($row));
         }
         M('Db')->setCurrentConnection('default');
         // TODO:
         // delete permissions
     }
     return $result;
 }
예제 #4
0
 /**
  *	Description...
  *
  *	@return void
  **/
 public function delete()
 {
     foreach ($this->_mapper->collectParams($this) as $item) {
         $item->delete();
     }
     if (!isNull($this->_fs())) {
         $this->_fs()->delete();
     }
     $this->_mapper->_deleteCollection('hide', $this);
     $this->_mapper->_deleteCollection('other', $this);
     $this->_mapper->_deleteCollection('other', $this);
     $this->_mapper->_deleteStorage($this);
     parent::delete();
 }
예제 #5
0
 /**
  * Deletes this object
  *
  * @return bool
  **/
 public function delete()
 {
     // нельзя удалить, если привязаны "дочерние" entities
     if (count($this->getChildren()) > 0) {
         $res = new RM_Base_Result();
         $res->error($this->type() . '_has_children');
         throw new RM_Validator_Exception($res);
     }
     // нельзя удалить, если привязаны штрих-коды
     if (count($this->getBarcodes()) > 0) {
         $res = new RM_Base_Result();
         $res->error('has_barcode');
         throw new RM_Validator_Exception($res);
     }
     $result = parent::delete();
     if ($result) {
         $this->resetTimeOfModification();
     }
     return $result;
 }
예제 #6
0
 /**
  * Deletes this object
  *
  * @return bool
  **/
 public function delete()
 {
     // нельзя удалить, если привязан к брикам
     if (count($this->getBricks()) > 0) {
         $res = new RM_Base_Result();
         $res->error('attribute_has_brick');
         throw new RM_Validator_Exception($res);
     }
     if (parent::delete()) {
         // удалить все зависимости value
         // удалить master2slave зависимости
         // .... хотя это делать не нужно, потому как если нету привязки к брикам, то и value нельзя привязать
         $this->resetTimeOfModification();
         return TRUE;
     }
     return FALSE;
 }
예제 #7
0
 public function delete($deleteSymlinks = FALSE)
 {
     $this->_mapper->access($this, 'OFS-DELETE');
     if (!isNull($parent = $this->getParent())) {
         $this->_mapper->access($this->getParent(), 'OFS-WRITE-CONTENT');
     }
     if ($deleteSymlinks) {
         $this->_mapper->entityDeleteSymlinks($this);
     }
     return parent::delete();
 }
예제 #8
0
 /**
  * Deletes this object and children nodes
  *
  * @return bool
  **/
 public function delete()
 {
     $this->access('EDIT');
     foreach ($this->getChildren() as $obEntity) {
         $this->_mapper->tree->removeNode($obEntity);
         $obEntity->delete();
     }
     $this->_mapper->tree->removeNode($this);
     return parent::delete();
 }
예제 #9
0
 /**
  *	Deletes ticket
  *
  *	@return		void
  */
 public function delete()
 {
     $this->_mapper->tree->removeNode($this);
     $this->state()->deleteStateHistory();
     $this->_mapper->deleteFromUnread($this);
     if ($this->level > 0 && !isNull($obRootTicket = $this->getRootOfBranch())) {
         $branch = $obRootTicket->getBranch();
         $obRootTicket->branch_count = count($branch);
         $obRootTicket->save();
     }
     return parent::delete();
 }
예제 #10
0
 /**
  * Enter description here...
  *
  * @return void
  */
 public function delete()
 {
     if (!$this->canDelete()) {
         throw new RM_Base_Exception_BadUsage(__METHOD__ . ': please use canDelete() method for check delete possibility');
     }
     return parent::delete();
 }
예제 #11
0
 /**
  * Deletes this object
  *
  * @return bool
  **/
 public function delete()
 {
     // нельзя удалить, если привязаны брики
     // You cannot delete object because there are bricks linked with this entity
     if (count($this->getBricks()) > 0) {
         $res = new RM_Base_Result();
         $res->error('has_brick');
         throw new RM_Validator_Exception($res);
     }
     // нельзя удалить, если привязаны штрих-коды
     // 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);
     }
     /*		foreach($this->getBricks() as $obBrick)
     			$obBrick->removeFlavour($this);
     		foreach($this->getBarcodes() as $obBarcode)
     			$obBarcode->removeFlavour($this);*/
     return parent::delete();
 }
예제 #12
0
 /**
  * Deletes this object
  *
  * @return bool
  **/
 public function delete()
 {
     // нельзя удалить, если привязан к атрибутам
     if (count($this->getAttributes()) > 0) {
         $res = new RM_Base_Result();
         $res->error('value_has_attribute');
         throw new RM_Validator_Exception($res);
     }
     if (parent::delete()) {
         // удалить master2slave зависимости
         $this->resetTimeOfModification();
         return TRUE;
     }
     return FALSE;
 }
예제 #13
0
 /**
  *	Description...
  *
  *	@return void
  **/
 public function delete()
 {
     if (!isNull($this->image())) {
         $this->image()->delete();
     }
     parent::delete();
 }
예제 #14
0
 public function delete()
 {
     $this->_fs()->delete();
     parent::delete();
 }