* @copyright 2010-2014 Justin Swanhart and André Rothe * @license http://www.debian.org/misc/bsd.license BSD License (3 Clause) * @version SVN: $Id: DeleteStatementBuilder.php 830 2013-12-18 09:35:42Z phosco@gmx.de $ * */ require_once dirname(__FILE__) . '/WhereBuilder.php'; require_once dirname(__FILE__) . '/FromBuilder.php'; require_once dirname(__FILE__) . '/DeleteBuilder.php'; /** * This class implements the builder for the whole Delete 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 DeleteStatementBuilder { protected function buildWHERE($parsed) { $builder = new WhereBuilder(); return $builder->build($parsed); } protected function buildFROM($parsed) { $builder = new FromBuilder(); return $builder->build($parsed); } protected function buildDELETE($parsed) { $builder = new DeleteBuilder(); return $builder->build($parsed); } public function processDeleteStatement($parsed) { $sql = $this->buildDELETE($parsed['DELETE']) . " " . $this->processFROM($parsed['FROM']); if (isset($parsed['WHERE'])) { $sql .= " " . $this->processWHERE($parsed['WHERE']); } return $sql; } } ?>