mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 23:55:35 +08:00
add cs fixer and PHPStan and activate it (build 436)
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace ZM\DB;
|
||||
|
||||
|
||||
use ZM\Exception\DbException;
|
||||
|
||||
/**
|
||||
* Class InsertBody
|
||||
* @package ZM\DB
|
||||
* @deprecated This will delete in 2.6 or future version, use \ZM\MySQL\MySQLManager::getConnection() instead
|
||||
*/
|
||||
class InsertBody
|
||||
@@ -17,14 +16,15 @@ class InsertBody
|
||||
* @var Table
|
||||
*/
|
||||
private $table;
|
||||
|
||||
private $row;
|
||||
|
||||
/**
|
||||
* InsertBody constructor.
|
||||
* @param Table $table
|
||||
* @param $row
|
||||
*/
|
||||
public function __construct(Table $table, $row) {
|
||||
public function __construct(Table $table, $row)
|
||||
{
|
||||
$this->table = $table;
|
||||
$this->row = $row;
|
||||
}
|
||||
@@ -32,7 +32,8 @@ class InsertBody
|
||||
/**
|
||||
* @throws DbException
|
||||
*/
|
||||
public function save() {
|
||||
public function save()
|
||||
{
|
||||
DB::rawQuery('INSERT INTO ' . $this->table->getTableName() . ' VALUES (' . implode(',', array_fill(0, count($this->row), '?')) . ')', $this->row);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user