本文整理匯總了PHP中Illuminate\Database\Eloquent\Builder::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Builder::destroy方法的具體用法?PHP Builder::destroy怎麽用?PHP Builder::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Illuminate\Database\Eloquent\Builder
的用法示例。
在下文中一共展示了Builder::destroy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
/**
* Delete models from the database by their primary key.
*
* @param mixed $ids
* @return bool
*/
public function delete($ids)
{
$ids = $this->convertToModelCollection($ids);
$results = $this->model->destroy($this->hookDelete($ids)->modelKeys());
$this->reset();
return $results;
}
示例2: delete
/**
* 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);
}
示例3: delete
/**
* @param $id
* @return mixed
*/
public function delete($id)
{
return $this->model->destroy($id);
}
示例4: delete
public function delete($id)
{
return $this->version->destroy($id);
}