/**
  * Validates input data
  *
  * @param mixed $data
  * @return void
  * @throws \InvalidArgumentException
  */
 public function validate($data)
 {
     if (!in_array($data, $this->getSelectOptions())) {
         throw new \InvalidArgumentException("Value specified for '{$this->getName()}' is not supported: '{$data}'");
     }
     parent::validate($data);
 }
 /**
  * Validates input data
  *
  * @param mixed $data
  * @return void
  * @throws \InvalidArgumentException
  */
 public function validate($data)
 {
     if (!is_string($data)) {
         throw new \InvalidArgumentException("'{$this->getName()}' must be a string");
     }
     parent::validate($data);
 }
Exemplo n.º 3
0
 /**
  * Constructor
  *
  * @param string $name
  * @param string $configPath
  * @param string $description
  * @param string|array|null $shortCut
  */
 public function __construct($name, $configPath, $description = '', $shortCut = null)
 {
     parent::__construct($name, self::FRONTEND_WIZARD_FLAG, self::VALUE_NONE, $configPath, $description, null, $shortCut);
 }