Exemplo n.º 1
0
 /**
  * Delete a record from the database.
  *
  * @param  mixed  $id
  * @return int
  */
 public function delete($id = null)
 {
     if (!is_null($id)) {
         $this->where('id', '=', $id);
     }
     $sql = $this->grammar->compileDelete($this);
     return $this->connection->delete($sql, $this->getBindings());
 }
Exemplo n.º 2
0
 /**
  * Delete a record from the database.
  *
  * @param  mixed  $id
  * @return int
  */
 public function delete($id = null)
 {
     // If an ID is passed to the method, we will set the where clause to check
     // the ID to allow developers to simply and quickly remove a single row
     // from their database without manually specifying the where clauses.
     if (!is_null($id)) {
         $this->where('id', '=', $id);
     }
     $sql = $this->grammar->compileDelete($this);
     return $this->connection->delete($sql, $this->getBindings());
 }