* @copyright 2010-2014 Justin Swanhart and André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * @version SVN: $Id: CreateTableBuilder.php 892 2013-12-31 00:21:33Z phosco@gmx.de $ * */ require_once dirname(__FILE__) . '/../exceptions/UnableToCreateSQLException.php'; require_once dirname(__FILE__) . '/CreateTableDefinitionBuilder.php'; require_once dirname(__FILE__) . '/CreateTableSelectOptionBuilder.php'; require_once dirname(__FILE__) . '/CreateTableOptionsBuilder.php'; /** * This class implements the builder for the CREATE TABLE 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 CreateTableBuilder { protected function buildCreateTableDefinition($parsed) { $builder = new CreateTableDefinitionBuilder(); return $builder->build($parsed); } protected function buildCreateTableOptions($parsed) { $builder = new CreateTableOptionsBuilder(); return $builder->build($parsed); } protected function buildCreateTableSelectOption($parsed) { $builder = new CreateTableSelectOptionBuilder(); return $builder->build($parsed); } public function build($parsed) { $sql = $parsed['name']; $sql .= $this->buildCreateTableDefinition($parsed); $sql .= $this->buildCreateTableOptions($parsed); $sql .= $this->buildCreateTableSelectOption($parsed); return $sql; } } ?>