* @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; use PHPSQLParser\exceptions\UnableToCreateSQLException; /** * This class implements the builder for the LIKE 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 LikeBuilder implements Builder { protected function buildTable($parsed, $index) { $builder = new TableBuilder(); return $builder->build($parsed, $index); } public function build(array $parsed) { $sql = $this->buildTable($parsed, 0); if (strlen($sql) === 0) { throw new UnableToCreateSQLException('LIKE', "", $parsed, 'table'); } return "LIKE " . $sql; } } ?>