Ejemplo n.º 1
0
 /**
  * Constructor.
  *
  * @param string                     $name
  * @param ResolvedFieldTypeInterface $type
  * @param array                      $options
  *
  * @throws \InvalidArgumentException When the name is invalid
  */
 public function __construct($name, ResolvedFieldTypeInterface $type, array $options = [])
 {
     FieldSet::validateName($name);
     if ('' === $name) {
         throw new \InvalidArgumentException(sprintf('The name "%s" contains illegal characters. Names should start with a letter, digit or underscore ' . 'and only contain letters, digits, numbers, underscores ("_") and hyphens ("-").', $name));
     }
     $this->name = $name;
     $this->type = $type;
     $this->options = $options;
     $this->locked = false;
 }
Ejemplo n.º 2
0
 /**
  * Constructor.
  *
  * @param string $name
  */
 public function __construct($name)
 {
     \Rollerworks\Component\Search\FieldSet::validateName($name);
     $this->name = $name;
 }