public function hasErrors($message = true)
    {
        if (empty($this->errors)) {
            return false;
        }

        if ($message) {
            $this->setMessage($this->text('One or more errors occurred'), 'danger');
        }

        if (isset($this->post_key)) {
            $this->setData($this->post_key, $this->submitted);
        }

        return true;
    }