. */ namespace Doctrine\ORM\Query\Exec; /** * Executes the SQL statements for bulk DQL DELETE statements on classes in * Class Table Inheritance (JOINED). * * @author Roman Borschel * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link http://www.doctrine-project.org * @since 2.0 * @version $Revision$ * @todo For a good implementation that uses temporary tables see the Hibernate sources: * (org.hibernate.hql.ast.exec.MultiTableDeleteExecutor). */ class MultiTableDeleteExecutor extends AbstractExecutor { public function __construct($AST) { // 1. Create a INSERT INTO temptable ... VALUES ( SELECT statement where the SELECT statement // selects the identifiers and uses the WhereClause of the $AST ). // 2. Create ID subselect statement used in DELETE .... WHERE ... IN (subselect) // 3. Create and store DELETE statements /*$subselect = 'SELECT id1, id2 FROM temptable'; foreach ($tableNames as $tableName) { $this->_sqlStatements[] = 'DELETE FROM ' . $tableName . ' WHERE (id1, id2) IN (subselect)'; }*/ // in $this->_sqlStatements } /** * Executes all sql statements. * * @param Doctrine_Connection $conn The database connection that is used to execute the queries. * @param array $params The parameters. * @override */ public function execute(\Doctrine\DBAL\Connection $conn, array $params) { // 1. Create temporary id table if necessary //... } }