コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function __invoke(SQLTransformer $transformer, Expression $expression, Configuration $config)
 {
     $name = $expression->getArg(0);
     if (!$name->isValue()) {
         throw new \InvalidArgumentException(sprintf('Field name should be a value'));
     }
     return new Clause($config->getNameResolver()->resolve($name->getValue()));
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function __invoke(FilterTransformer $transformer, Expression $expression, $element, Configuration $config)
 {
     $name = $expression->getArg(0);
     if (!$name->isValue()) {
         throw new \InvalidArgumentException(sprintf('Field name should be a value, expression "%s" given', $name->getExp()));
     }
     $name = $config->getNameResolver()->resolve($name->getValue());
     return $this->propertyAccessor->getValue($element, $name);
 }