public function testConfigMode() { $options = array('waitflush' => true, 'waitsearcher' => false, 'expungedeletes' => true); $command = new Solarium_Query_Update_Command_Commit($options); $this->assertEquals(true, $command->getWaitFlush()); $this->assertEquals(false, $command->getWaitSearcher()); $this->assertEquals(true, $command->getExpungeDeletes()); }
/** * Build XML for a commit command * * @param Solarium_Query_Update_Command_Commit $command * @return string */ public function buildCommitXml($command) { $xml = '<commit'; $xml .= $this->boolAttrib('waitFlush', $command->getWaitFlush()); $xml .= $this->boolAttrib('waitSearcher', $command->getWaitSearcher()); $xml .= $this->boolAttrib('expungeDeletes', $command->getExpungeDeletes()); $xml .= '/>'; return $xml; }
/** * Convenience method to add a commit 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 boolean $waitFlush * @param boolean $waitSearcher * @param boolean $expungeDeletes * @return Solarium_Query_Update Provides fluent interface */ public function addCommit($waitFlush = null, $waitSearcher = null, $expungeDeletes = null) { $commit = new Solarium_Query_Update_Command_Commit(); if (null !== $waitFlush) { $commit->setWaitFlush($waitFlush); } if (null !== $waitSearcher) { $commit->setWaitSearcher($waitSearcher); } if (null !== $expungeDeletes) { $commit->setExpungeDeletes($expungeDeletes); } return $this->add(null, $commit); }