/** * @param FilterRuleInterface $rule * @param Builder $query * * @return bool */ public function setRule(FilterRuleInterface $rule, Builder $query) { $this->rule = $rule; $this->rule->setField($this); $this->rule->getOperator()->select($query); $this->rule->getOperator()->query($query); }
/** * @param Builder $query */ public function query(Builder $query) { if (method_exists($this->getRule()->getField(), 'query')) { return $this->rule->getField()->query($query); } else { return $this->getQuery($query, $this->getQueryField(), $this->getCondition()); } }