public function caseSensitive($caseSensitive) { if (!isset($this->query['$text'])) { throw new BadMethodCallException('This method requires a $text operator (call text() first)'); } // Remove caseSensitive option to keep support for older database versions if ($caseSensitive) { $this->query['$text']['$caseSensitive'] = true; } elseif (isset($this->query['$text']['$caseSensitive'])) { unset($this->query['$text']['$caseSensitive']); } return $this; }
/** * A boolean flag to enable or disable case sensitive search for $text * criteria. * * This method must be called after text(). * * @see Expr::caseSensitive() * @see http://docs.mongodb.org/manual/reference/operator/text/ * @param bool $caseSensitive * @return $this * @throws BadMethodCallException if the query does not already have $text criteria * * @since 1.3 */ public function caseSensitive($caseSensitive) { $this->expr->caseSensitive($caseSensitive); return $this; }