delete() public method

Delete a record from the database.
public delete ( mixed $id = null ) : integer
$id mixed
return integer
コード例 #1
0
ファイル: DBOperator.php プロジェクト: kyleing/gtbool
 function delete($id)
 {
     $retId = $this->operator->delete($id);
     if ($retId) {
         //todo if here a bug ?
         $obj[$this->pkey] = $retId;
     }
     return $id;
 }
コード例 #2
0
 /**
  * delete data
  *
  * @return int
  */
 public function delete()
 {
     if ($this->dynamic === false) {
         return $this->query->delete();
     }
     $result = $this->query->delete();
     if ($this->proxy === true) {
         $wheres = $this->query->wheres === null ? [] : $this->query->wheres;
         $this->getProxyManager()->delete($wheres);
     }
     return $result;
 }
コード例 #3
0
ファイル: Builder.php プロジェクト: aysenli/laravel-admin-1
 /**
  * Force a delete on a set of soft deleted models.
  *
  * @return int
  */
 public function forceDelete()
 {
     return $this->query->delete();
 }
コード例 #4
0
ファイル: QueryBuilder.php プロジェクト: spiritix/lada-cache
 /**
  * Delete a record from the database.
  *
  * @param  null|int $id
  *
  * @return int
  */
 public function delete($id = null)
 {
     $result = parent::delete($id);
     $this->handler->setBuilder($this)->setValues([Reflector::PRIMARY_KEY_COLUMN => $id])->setSqlOperation('delete')->invalidateQuery('delete');
     return $result;
 }
コード例 #5
0
ファイル: QueryBuilder.php プロジェクト: angejia/pea
 public function delete($id = null)
 {
     if ($this->needFlushCache()) {
         // 清空表级缓存
         $meta = $this->getMeta();
         $meta->flush($this->db(), $this->model->table());
         $this->flushAffectingRowCache();
     }
     return parent::delete($id);
 }
コード例 #6
0
ファイル: QueryBuilder.php プロジェクト: spiritix/lada-cache
 /**
  * Delete a record from the database.
  *
  * @param  null|int $id
  *
  * @return int
  */
 public function delete($id = null)
 {
     $result = parent::delete($id);
     $this->handler->setBuilder($this)->invalidateQuery(Reflector::QUERY_TYPE_DELETE, [Reflector::PRIMARY_KEY_COLUMN => $id]);
     return $result;
 }
コード例 #7
0
ファイル: DBOperator.php プロジェクト: kyleing/laravel-tool
 function delete($id = null)
 {
     return $this->_operator->delete($id);
 }