Doctrine\MongoDB\Query\Expr::language PHP Method

language() public method

This method must be called after text().
See also: Builder::language()
See also: http://docs.mongodb.org/manual/reference/operator/text/
public language ( string $language )
$language string
    public function language($language)
    {
        if (!isset($this->query['$text'])) {
            throw new BadMethodCallException('This method requires a $text operator (call text() first)');
        }
        $this->query['$text']['$language'] = (string) $language;
        return $this;
    }

Usage Example

示例#1
0
 /**
  * Set the $language option for $text criteria.
  *
  * This method must be called after text().
  *
  * @see Expr::language()
  * @see http://docs.mongodb.org/manual/reference/operator/text/
  * @param string $language
  * @return $this
  */
 public function language($language)
 {
     $this->query->language($language);
     return $this;
 }
All Usage Examples Of Doctrine\MongoDB\Query\Expr::language