public function error($key = null, $return_error = null, $return_no_error = '')
    {
        if (isset($key)) {
            $result = gplcart_array_get($this->errors, $key);
        } else {
            $result = empty($this->errors) ? null : $this->errors;
        }

        if (isset($result)) {
            return isset($return_error) ? $return_error : $result;
        }

        return $return_no_error;
    }
public function error($key = null, $return_error = null, $return_no_error = '')
    {
        if (isset($key)) {
            $result = gplcart_array_get($this->errors, $key);
        } else {
            $result = empty($this->errors) ? null : $this->errors;
        }

        if (isset($result)) {
            return isset($return_error) ? $return_error : $result;
        }

        return $return_no_error;
    }
public function error ( $ key = null , $ return_error = null , $ return_no_error = '' ) { if ( isset ( $ key ) ) { $ result = gplcart_array_get ( $ this -> errors , $ key ) ; } else { $ result = empty ( $ this -> errors ) ? null : $ this -> errors ; } if ( isset ( $ result ) ) { return isset ( $ return_error ) ? $ return_error : $ result ; } return $ return_no_error ; }
Returns a value if an error occurred
@param string|array $key
@param mixed $return_error
@param mixed $return_no_error
@return mixed
Returns a value if an error occurred