* @copyright 2010-2014 Justin Swanhart and André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * @version SVN: $Id$ * */ namespace PHPSQLParser\builders; /** * This class implements the builder for the select-options statement part of CREATE TABLE. * 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 CreateTableSelectOptionBuilder implements Builder { public function build(array $parsed) { if (!isset($parsed['select-option']) || $parsed['select-option'] === false) { return ""; } $option = $parsed['select-option']; $sql = ($option['duplicates'] === false ? '' : (' ' . $option['duplicates'])); $sql .= ($option['as'] === false ? '' : ' AS'); return $sql; } } ?>