mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 05:04:51 +08:00
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
35 lines
567 B
PHP
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);
|
|
}
|
|
}
|