mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-07 08:45:37 +08:00
update to build 417
This commit is contained in:
29
src/ZM/MySQL/MySQLQueryBuilder.php
Normal file
29
src/ZM/MySQL/MySQLQueryBuilder.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace ZM\MySQL;
|
||||
|
||||
|
||||
use Doctrine\DBAL\Query\QueryBuilder;
|
||||
use ZM\Exception\DbException;
|
||||
|
||||
class MySQLQueryBuilder extends QueryBuilder
|
||||
{
|
||||
private $wrapper;
|
||||
|
||||
public function __construct(MySQLWrapper $wrapper) {
|
||||
parent::__construct($wrapper->getConnection());
|
||||
$this->wrapper = $wrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|MySQLStatementWrapper
|
||||
* @throws DbException
|
||||
*/
|
||||
public function execute() {
|
||||
if ($this->getType() === self::SELECT) {
|
||||
return $this->wrapper->executeQuery($this->getSQL(), $this->getParameters(), $this->getParameterTypes());
|
||||
}
|
||||
return $this->wrapper->executeStatement($this->getSQL(), $this->getParameters(), $this->getParameterTypes());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user