model = $query->applyRelation($this->relation); $values = explode(',', $this->getValue()); foreach($values as $value) { $matches[] = sprintf("%s LIKE '%s%%'", $this->getDbName(), Convert::raw2sql(str_replace("'", '', $value)) ); } return $query->where(implode(" OR ", $matches)); } public function isEmpty() { return $this->getValue() == null || $this->getValue() == ''; } }