/**
  * Constructor
  *
  * @param string $name
  * @param string $frontendType
  * @param string $configPath
  * @param string $description
  * @param string|null $defaultValue
  * @param string|array|null $shortCut
  * @throws \InvalidArgumentException
  */
 public function __construct($name, $frontendType, $configPath, $description = '', $defaultValue = null, $shortCut = null)
 {
     if ($frontendType != self::FRONTEND_WIZARD_TEXT && $frontendType != self::FRONTEND_WIZARD_PASSWORD && $frontendType != self::FRONTEND_WIZARD_TEXTAREA) {
         throw new \InvalidArgumentException("Frontend input type has to be 'text', 'textarea' or 'password'.");
     }
     parent::__construct($name, $frontendType, self::VALUE_REQUIRED, $configPath, $description, $defaultValue, $shortCut);
 }
 /**
  * Constructor
  *
  * @param string $name
  * @param string $frontendType
  * @param array $selectOptions
  * @param string $configPath
  * @param string $description
  * @param array $defaultValue
  * @param string|array|null $shortCut
  * @throws \InvalidArgumentException
  */
 public function __construct($name, $frontendType, array $selectOptions, $configPath, $description = '', array $defaultValue = [], $shortCut = null)
 {
     if ($frontendType != self::FRONTEND_WIZARD_MULTISELECT && $frontendType != self::FRONTEND_WIZARD_CHECKBOX) {
         throw new \InvalidArgumentException("Frontend input type has to be 'multiselect', 'textarea' or 'checkbox'.");
     }
     if (!$selectOptions) {
         throw new \InvalidArgumentException('Select options can\'t be empty.');
     }
     $this->selectOptions = $selectOptions;
     parent::__construct($name, $frontendType, self::VALUE_REQUIRED | self::VALUE_IS_ARRAY, $configPath, $description, $defaultValue, $shortCut);
 }
 /**
  * Constructor
  *
  * @param string $name
  * @param string $frontendType
  * @param array $selectOptions
  * @param string $configPath
  * @param string $description
  * @param string|null $defaultValue
  * @param string|array|null $shortCut
  * @throws \InvalidArgumentException
  */
 public function __construct($name, $frontendType, array $selectOptions, $configPath, $description = '', $defaultValue = null, $shortCut = null)
 {
     if ($frontendType != self::FRONTEND_WIZARD_SELECT && $frontendType != self::FRONTEND_WIZARD_RADIO) {
         throw new \InvalidArgumentException("Frontend input type has to be 'select' or 'radio'.");
     }
     if (!$selectOptions) {
         throw new \InvalidArgumentException('Select options can\'t be empty.');
     }
     $this->selectOptions = $selectOptions;
     parent::__construct($name, $frontendType, self::VALUE_REQUIRED, $configPath, $description, $defaultValue, $shortCut);
 }
예제 #4
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);
 }