selectOptions = $selectOptions; parent::__construct( $name, $frontendType, self::VALUE_REQUIRED | self::VALUE_IS_ARRAY, $configPath, $description, $defaultValue, $shortCut ); } /** * Get available options * * @return array */ public function getSelectOptions() { return $this->selectOptions; } /** * Validates input data * * @param mixed $data * @return void * @throws \InvalidArgumentException */ public function validate($data) { if (is_array($data)) { foreach ($data as $value) { if (!in_array($value, $this->getSelectOptions())) { throw new \InvalidArgumentException( "Value specified for '{$this->getName()}' is not supported: '{$value}'" ); } } } parent::validate($data); } }