Gregwar\Formidable\Fields\Select::check PHP Method

check() public method

public check ( )
    public function check()
    {
        if ($error = parent::check()) {
            return $error;
        }
        if (!$this->required && $this->value == '') {
            return;
        } else {
            foreach ($this->options as $opt) {
                if ($this->multiple && in_array($opt->getValue(), $this->value) || !$this->multiple && $this->value == $opt->getValue()) {
                    return;
                }
            }
        }
        return array('should_choose', $this->printName());
    }