Example #1
0
 /**
  * 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 $softCommit
  * @param boolean $waitSearcher
  * @param boolean $expungeDeletes
  *
  * @return self Provides fluent interface
  */
 public function addCommit($softCommit = null, $waitSearcher = null, $expungeDeletes = null)
 {
     $commit = new CommitCommand();
     if (null !== $softCommit) {
         $commit->setSoftCommit($softCommit);
     }
     if (null !== $waitSearcher) {
         $commit->setWaitSearcher($waitSearcher);
     }
     if (null !== $expungeDeletes) {
         $commit->setExpungeDeletes($expungeDeletes);
     }
     return $this->add(null, $commit);
 }