/** * 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; }
/** * Constructor. * * @param string $name */ public function __construct($name) { \Rollerworks\Component\Search\FieldSet::validateName($name); $this->name = $name; }