update parser_sql

This commit is contained in:
shreesh arora
2021-05-03 01:06:30 +05:30
parent b7ef2391cc
commit d91def3d84
172 changed files with 8743 additions and 2571 deletions

View File

@@ -35,13 +35,11 @@
* @author André Rothe <andre.rothe@phosco.info>
* @copyright 2010-2014 Justin Swanhart and André Rothe
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
* @version SVN: $Id: UpdateStatementBuilder.php 830 2013-12-18 09:35:42Z phosco@gmx.de $
* @version SVN: $Id$
*
*/
require_once dirname(__FILE__) . '/WhereBuilder.php';
require_once dirname(__FILE__) . '/SetBuilder.php';
require_once dirname(__FILE__) . '/UpdateBuilder.php';
namespace PHPSQLParser\builders;
/**
* This class implements the builder for the whole Update statement. You can overwrite
@@ -51,7 +49,7 @@ require_once dirname(__FILE__) . '/UpdateBuilder.php';
* @license http://www.debian.org/misc/bsd.license BSD License (3 Clause)
*
*/
class UpdateStatementBuilder {
class UpdateStatementBuilder implements Builder {
protected function buildWHERE($parsed) {
$builder = new WhereBuilder();
@@ -68,7 +66,7 @@ class UpdateStatementBuilder {
return $builder->build($parsed);
}
public function build($parsed) {
public function build(array $parsed) {
$sql = $this->buildUPDATE($parsed['UPDATE']) . " " . $this->buildSET($parsed['SET']);
if (isset($parsed['WHERE'])) {
$sql .= " " . $this->buildWHERE($parsed['WHERE']);