public function testConfigModeMultiValue()
 {
     $options = array('id' => array(1, 2), 'query' => array('id:1', 'id:2'));
     $command = new Solarium_Query_Update_Command_Delete($options);
     $this->assertEquals(array(1, 2), $command->getIds());
     $this->assertEquals(array('id:1', 'id:2'), $command->getQueries());
 }
示例#2
0
 /**
  * Build XML for a delete command
  *
  * @param Solarium_Query_Update_Command_Delete $command
  * @return string
  */
 public function buildDeleteXml($command)
 {
     $xml = '<delete>';
     foreach ($command->getIds() as $id) {
         $xml .= '<id>' . htmlspecialchars($id, ENT_NOQUOTES, 'UTF-8') . '</id>';
     }
     foreach ($command->getQueries() as $query) {
         $xml .= '<query>' . htmlspecialchars($query, ENT_NOQUOTES, 'UTF-8') . '</query>';
     }
     $xml .= '</delete>';
     return $xml;
 }