* @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 [DELETE] part. 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 DeleteBuilder implements Builder { public function build(array $parsed) { $sql = "DELETE "; $right = -1; if ($parsed['options'] !== false) { foreach ($parsed['options'] as $k => $v) { $sql .= $v . " "; } } if ($parsed['tables'] !== false) { foreach ($parsed['tables'] as $k => $v) { $sql .= $v . ", "; $right = -2; } } return substr($sql, 0, $right); } } ?>