delete() public method

Delete a record from the database.
public delete ( ) : mixed
return mixed
Beispiel #1
0
 /**
  * Delete one or more model records from the database
  *
  * @return mixed
  */
 public function delete()
 {
     $this->newQuery()->setClauses()->setScopes();
     $result = $this->query->delete();
     $this->unsetClauses();
     return $result;
 }
Beispiel #2
0
 /**
  * Deletes an item if an id is specified, deletes all queried entries otherwise
  *
  * @param  integer $id
  * @return bool
  */
 public function delete($id = null)
 {
     if ($id === null) {
         $delete = $this->builder->delete();
         $this->newBuilder();
         return $delete;
     }
     return $this->builder->destroy($id);
 }
Beispiel #3
0
 /**
  * Delete a record from the database.
  *
  * @return mixed
  */
 public function delete()
 {
     // Intercept operations on embedded models and delegate logic
     // to the parent relation instance.
     if ($relation = $this->model->getParentRelation()) {
         $relation->performDelete($this->model);
         return $this->model->getKey();
     }
     return parent::delete();
 }
 /**
  * @return bool|null
  * @throws \Exception
  */
 public function delete()
 {
     $this->specificationQuery->delete();
     return true;
 }
 /**
  * Delete a record from the database.
  *
  * @return mixed
  */
 public function delete()
 {
     $this->model->fireEvent('deletingMultiple');
     $return = parent::delete();
     $this->model->fireEvent('deletedMultiple');
     return $return;
 }
Beispiel #6
0
 public function delete()
 {
     if ($this->eagerLoad) {
         $this->prepareQuery();
         $this->buildRelationshipTree();
         $this->applyRelationshipQuery($this->relations);
         $this->reformatQueryComponents();
     }
     parent::delete();
 }