// Don't filter on empty strings.
if (empty($this->value
)) { return;
} // Match all words separated by spaces or sentences encapsulated by double
// quotes.
preg_match_all(static::WORDS_PATTERN, ' ' .
$this->value,
$matches, PREG_SET_ORDER
);
// Switch between the 'word' and 'allwords' operator.
$type =
$this->operator == 'word' ? 'OR' : 'AND';
$group =
$this->query->
setWhereGroup($type);
$operator =
$this->
getConditionOperator('LIKE'
);
foreach ($matches as $match_key =>
$match) { $temp_placeholder =
$placeholder . '_' .
$match_key;
// Clean up the user input and remove the sentence delimiters.
$word =
trim($match[2
], ',?!();:-"'
);
$this->query->
addWhereExpression($group, "
$expression $operator $temp_placeholder",
[$temp_placeholder => '%' .
$this->connection->
escapeLike($word) . '%'
]);
} } protected function opStartsWith($expression) {