* @copyright 2010-2014 Justin Swanhart and André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * @version SVN: $Id: InsertStatementBuilder.php 834 2013-12-18 10:14:26Z phosco@gmx.de $ * */ require_once dirname(__FILE__) . '/InsertBuilder.php'; require_once dirname(__FILE__) . '/ValuesBuilder.php'; /** * This class implements the builder for the whole Insert statement. You can overwrite * all functions to achieve another handling. * * @author André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * */ class InsertStatementBuilder { protected function buildVALUES($parsed) { $builder = new ValuesBuilder(); return $builder->build($parsed); } protected function buildINSERT($parsed) { $builder = new InsertBuilder($parsed); return $builder->build($parsed); } public function build($parsed) { // TODO: are there more than one tables possible (like [INSERT][1]) return $this->buildINSERT($parsed['INSERT'][0]) . " " . $this->buildVALUES($parsed['VALUES']); // TODO: subquery? } } ?>