zhamao-framework/src/ZM/DB/DeleteBody.php
whale 169a751e0f update to 1.2 version
Generate systemd script
Default info_level set to 2
Modify & add some comment for Example module
Brand new Console
Add daemon command argument
Add #OnTick annotation
Add ZMRobot API class
2020-04-29 15:29:56 +08:00

35 lines
567 B
PHP

<?php
namespace ZM\DB;
use ZM\Exception\DbException;
class DeleteBody
{
use WhereBody;
/**
* @var Table
*/
private $table;
/**
* DeleteBody constructor.
* @param Table $table
*/
public function __construct(Table $table) {
$this->table = $table;
}
/**
* @return mixed
* @throws DbException
*/
public function save() {
list($sql, $param) = $this->getWhereSQL();
return DB::rawQuery("DELETE FROM " . $this->table->getTableName() . " WHERE " . $sql, $param);
}
}