Beispiel #1
0
 public function exec(Context $context, $name)
 {
     $this->context = $context;
     if (isset($context->data[$name])) {
         $context->data[$name] = $this->apply($context->getValue($name));
     }
     $this->context = null;
 }
Beispiel #2
0
 protected function error(Context $context, $name)
 {
     $expected = $this->expected;
     if (is_string($this->with)) {
         $expected = $context->trans($this->with);
     }
     throw (new Error($this->getErrorMessage("filter.rule.compare.{$this->op}")))->setArgs(["%value%" => $context->getValue($name), "%name%" => $context->trans($name), "%expected%" => $expected])->setName(is_string($this->with) ? $name . "." . $this->with : $name);
 }
Beispiel #3
0
 public function exec(Context $context, $name)
 {
     $this->context = $context;
     $res = $this->apply($context->getValue($name));
     $this->context = null;
     if (!$res) {
         $this->error($context, $name);
     }
 }