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/InsertBody.php
Normal file
28
src/ZM/DB/InsertBody.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\DB;
|
||||
|
||||
|
||||
class InsertBody
|
||||
{
|
||||
/**
|
||||
* @var Table
|
||||
*/
|
||||
private $table;
|
||||
private $row;
|
||||
|
||||
/**
|
||||
* InsertBody constructor.
|
||||
* @param Table $table
|
||||
* @param $row
|
||||
*/
|
||||
public function __construct(Table $table, $row) {
|
||||
$this->table = $table;
|
||||
$this->row = $row;
|
||||
}
|
||||
|
||||
public function save() {
|
||||
DB::rawQuery('INSERT INTO ' . $this->table->getTableName() . ' VALUES ('.implode(',', array_fill(0, 5, '?')).')', $this->row);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user