/** * Replace token values in the comparison values. */ private function visitComparison(Comparison $comparison) { if ($comparison->getField() === 'run') { $this->replaceValue($comparison); } }
private function visitParam(Comparison $comparison) { if (!preg_match('{param\\[(.+?)\\]}', $comparison->getField(), $matches)) { throw new \InvalidArgumentException(sprintf('Parameter field "%s" must be of form "param[param_name]"', $comparison->getField())); } $paramName = $matches[1]; return sprintf('parameter.pkey = :%s AND parameter.value %s :%s', $this->registerParamValue($paramName), $this->getComparatorSql($comparison), $this->registerParamValue($comparison->getValue())); }