public function getError($componentName = null, $default = null)
    {
        $result = $default;

        if (null === $componentName) {
            $result = $this->error;

        } else {
            if ($this->hasError($componentName)) {
                $result = $this->error[$componentName];
            }
        }

        return $result;
    }
public function getError($componentName = null, $default = null)
    {
        $result = $default;

        if (null === $componentName) {
            $result = $this->error;

        } else {
            if ($this->hasError($componentName)) {
                $result = $this->error[$componentName];
            }
        }

        return $result;
    }
public function getError ( $ componentName = null , $ default = null ) { $ result = $ default ; if ( null === $ componentName ) { $ result = $ this -> error ; } else { if ( $ this -> hasError ( $ componentName ) ) { $ result = $ this -> error [ $ componentName ] ; } } return $ result ; }
Returns the error of a component.

@param string      $componentName The name of the component to return data for
@param string|null $default       The default return value as string or NULL

@author Benjamin Carl <opensource@clickalicious.de>

@return mixed The value of the component if exist, otherwise the $default value
Returns the error of a component .