protected function applyMany(DataQuery $query) { $this->model = $query->applyRelation($this->relation); $whereClause = array(); $comparisonClause = DB::get_conn()->comparisonClause($this->getDbName(), null, false, false, $this->getCaseSensitive(), true); foreach ($this->getValue() as $value) { $whereClause[] = array($comparisonClause => $this->getMatchPattern($value)); } return $query->whereAny($whereClause); }