public function required($options) {
        if ((is_array($options) || (!is_array($options) && $options))) {
            if ((is_array($this->elementData) && (empty($this->elementData) || (empty($this->elementData[0]) && count($this->elementData) === 1))) ||
                    (!is_array($this->elementData) && trim($this->elementData) === '')) {
                if (is_bool($options))
                    $this->addError('Field is required');
                else if (is_array($options) && isset($options['message'])) {
                    $this->addError($options['message']);
                } else
                    $this->addError((!is_array($options) && !is_object($options)) ? $options : 'Field is required');
                return false;
            }
            return true;
        }
        return true;
    }