public function __construct($name, $callback, $description, $dataType, $rel = null, $validationParameters = [])
 {
     parent::__construct($name, $callback, $description, $dataType, $rel);
     $this->validationParameters = $validationParameters;
 }
Beispiel #2
0
 protected function processField(Field $field)
 {
     $f = ['name' => $field->getName(), 'type' => $field->getDataType()];
     $rel = $field->getRel();
     if (mb_strlen($rel) > 0) {
         $f['rel'] = $rel;
     }
     return $f;
 }
 /**
  * {@inheritdoc}
  */
 public function applyField(CompiledTransformMappingInterface $transformMapping, $instance, Field $field, $value)
 {
     $callback = $field->getCallback();
     $this->setFieldValue($instance, $callback, $value);
 }
 /**
  * {@inheritdoc}
  */
 public function rolesForField(Field $field, $securityAttribute, $pathPrefix)
 {
     $roles = [$this->roleName($pathPrefix, 'field', $field->getName()), $this->roleName($pathPrefix, 'field', $field->getName(), $securityAttribute), $this->roleName($pathPrefix, 'field', 'all'), $this->roleName($pathPrefix, 'field', 'all', $securityAttribute)];
     return $this->makeRoles($roles);
 }