public function hasErrors($attribute = null)
    {
        if (!count($this->_errors)) {
            return false;
        }
        if ($attribute && isset($this->_errors[$attribute]) && count($this->_errors[$attribute])) {
            return true;
        } elseif ($attribute) {
            return false;
        }
        return true;
    }
public function hasErrors($attribute = null)
    {
        if (!count($this->_errors)) {
            return false;
        }
        if ($attribute && isset($this->_errors[$attribute]) && count($this->_errors[$attribute])) {
            return true;
        } elseif ($attribute) {
            return false;
        }
        return true;
    }
public function hasErrors ( $ attribute = null ) { if ( ! count ( $ this -> _errors ) ) { return false ; } if ( $ attribute && isset ( $ this -> _errors [ $ attribute ] ) && count ( $ this -> _errors [ $ attribute ] ) ) { return true ; } elseif ( $ attribute ) { return false ; } return true ; }
Check if the entire model has errors or a specific attribute
@param null|string $attribute
@return boolean
Check if the entire model has errors or a specific attribute