summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2015-11-08 14:14:45 +0200
committerDan Ungureanu <udan1107@gmail.com>2015-11-08 14:14:45 +0200
commitc60987f15f8732bafa28b47de542bdb525cfe128 (patch)
treeeea7bae1a6f745a9d6ae691f2df3ec6f870cac94 /src
parent77974239bb04637a0dceefc3a301e345952fbbd0 (diff)
downloadsql-parser-c60987f15f8732bafa28b47de542bdb525cfe128.zip
sql-parser-c60987f15f8732bafa28b47de542bdb525cfe128.tar.gz
sql-parser-c60987f15f8732bafa28b47de542bdb525cfe128.tar.bz2
Added INSERT statement builder.
Diffstat (limited to 'src')
-rw-r--r--src/Statements/InsertStatement.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Statements/InsertStatement.php b/src/Statements/InsertStatement.php
index 303de25..ce11de3 100644
--- a/src/Statements/InsertStatement.php
+++ b/src/Statements/InsertStatement.php
@@ -11,6 +11,7 @@ namespace SqlParser\Statements;
use SqlParser\Statement;
use SqlParser\Components\IntoKeyword;
use SqlParser\Components\Array2d;
+use SqlParser\Components\ArrayObj;
/**
* `INSERT` statement.
@@ -76,7 +77,16 @@ class InsertStatement extends Statement
/**
* Values to be inserted.
*
- * @var Array2d
+ * @var ArrayObj[]
*/
public $values;
+
+ /**
+ * @return string
+ */
+ public function build() {
+ return 'INSERT ' . $this->options
+ . ' INTO ' . $this->into
+ . ' VALUES ' . ArrayObj::build($this->values);
+ }
}