コード例 #1
0
ファイル: Builder.php プロジェクト: mrjgreen/database
 /**
  * Delete a record from the database.
  *
  * @param  mixed $id
  * @return \PDOStatement
  */
 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->query($sql, $this->getBindings());
 }