Beispiel #1
0
 /**
  * Adds a word phrase to be searched in all properties.
  *
  * @param string|SearchQuery $value The word phrase
  * @param int $match The match type. One of SearchQueryMatch::* values
  * @throws \InvalidArgumentException
  */
 public function value($value, $match = SearchQueryMatch::DEFAULT_MATCH)
 {
     if ($value instanceof SearchQuery && $value->isComplex() && $match != SearchQueryMatch::DEFAULT_MATCH) {
         throw new \InvalidArgumentException('The match argument can be specified only if the value argument is a string or a simple query.');
     }
     $this->andOperatorIfNeeded();
     $expr = $value instanceof SearchQuery ? $value->getExpression() : new SearchQueryExprValue($value, $match);
     $this->expr->add($expr);
 }