コード例 #1
0
ファイル: LiteralMatcher.php プロジェクト: koolkode/k2
 public function applyMatcher($expression, QueryContext $context)
 {
     if (empty($this->values)) {
         return '0';
     }
     if (count($this->values) == 1) {
         return $expression . ' = ' . $context->append((string) $this->values[0]);
     }
     $sql = $expression . ' IN (';
     foreach ($this->values as $i => $value) {
         if ($i != 0) {
             $sql .= ', ';
         }
         $sql .= $context->append($value);
     }
     return $sql . ')';
 }
コード例 #2
0
ファイル: RegexMatcher.php プロジェクト: koolkode/k2
 public function applyMatcher($expression, QueryContext $context)
 {
     return $expression . ' REGEXP ' . $context->append($this->regex);
 }
コード例 #3
0
ファイル: PatternMatcher.php プロジェクト: koolkode/k2
 public function applyMatcher($expression, QueryContext $context)
 {
     return $expression . ' LIKE ' . $context->append($this->pattern);
 }