/** * Convenience method for adding a delete query command. * * If you need more control, like choosing a key for the command you need to * create you own command instance and use the add method. * * @param string $query * @param array $bind Bind values for placeholders in the query string * * @return self Provides fluent interface */ public function addDeleteQuery($query, $bind = null) { if (!is_null($bind)) { $query = $this->getHelper()->assemble($query, $bind); } $delete = new DeleteCommand(); $delete->addQuery($query); return $this->add(null, $delete); }
public function testBuildDeleteXmlIdAndQuerySpecialChars() { $command = new DeleteCommand(); $command->addId('special<char>id'); $command->addQuery('id:special<char>id'); $this->assertEquals('<delete><id>special<char>id</id><query>id:special<char>id</query></delete>', $this->builder->buildDeleteXml($command)); }