3 namespace Wallabag\CoreBundle\Operator\Doctrine
;
6 * Provides a "matches" operator used for tagging rules.
8 * It asserts that a given pattern is contained in a subject, in a
9 * case-insensitive way.
11 * This operator will be used to compile tagging rules in DQL, usable
13 * It's registered in RulerZ using a service (wallabag.operator.doctrine.matches);
17 public function __invoke($subject, $pattern)
19 if ($pattern[0] === "'") {
20 $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1));
23 return sprintf('UPPER(%s) LIKE UPPER(%s)', $subject, $pattern);