コード例 #1
0
ファイル: Query.php プロジェクト: starsw001/solarium
 /**
  * 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);
 }
コード例 #2
0
 public function testBuildDeleteXmlIdAndQuerySpecialChars()
 {
     $command = new DeleteCommand();
     $command->addId('special<char>id');
     $command->addQuery('id:special<char>id');
     $this->assertEquals('<delete><id>special&lt;char&gt;id</id><query>id:special&lt;char&gt;id</query></delete>', $this->builder->buildDeleteXml($command));
 }