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