mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 07:35:34 +08:00
initial commit
This commit is contained in:
28
src/ZM/DB/DeleteBody.php
Normal file
28
src/ZM/DB/DeleteBody.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\DB;
|
||||
|
||||
|
||||
class DeleteBody
|
||||
{
|
||||
use WhereBody;
|
||||
|
||||
/**
|
||||
* @var Table
|
||||
*/
|
||||
private $table;
|
||||
|
||||
/**
|
||||
* DeleteBody constructor.
|
||||
* @param Table $table
|
||||
*/
|
||||
public function __construct(Table $table) {
|
||||
$this->table = $table;
|
||||
}
|
||||
|
||||
public function save() {
|
||||
list($sql, $param) = $this->getWhereSQL();
|
||||
return DB::rawQuery("DELETE FROM " . $this->table->getTableName() . " WHERE " . $sql, $param);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user