Path

ez components / documentation / api reference / 2008.2.3 / document


eZ Components 2008.2.3

Document: ezcDocumentValidationError

[ Tutorial ] [ Conversion ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcDocumentValidationError

Unifies different errors into a single structure for all kinds of validation errors. The validation error message can be fetched using the __toString() method, while the original error is still be available, fi required. [source]

Member Variables

protected mixed $error
Original error object
protected array $errorTypes = array(
LIBXML_ERR_WARNING => 'Warning',
LIBXML_ERR_ERROR => 'Error',
LIBXML_ERR_FATAL => 'Fatal error',
)

textual mapping for libxml error types.
protected string $message
Transformed error message.

Method Summary

protected void __construct( $message, [$error = null] )
Create validation error object
public static ezcDocumentValidationError createFromException( $e )
Create validation error from Exception
public static ezcDocumentValidationError createFromLibXmlError( $error )
Create from LibXmlError
public mixed getOriginalError( )
Get original error object
public void __toString( )
Convert libXML error to string

Methods

__construct

void __construct( string $message, [mixed $error = null] )
Create validation error object

Parameters

Name Type Description
$message string  
$error mixed  

createFromException

ezcDocumentValidationError createFromException( $e )
Create validation error from Exception

Parameters

Name Type Description
$e Exception  

createFromLibXmlError

ezcDocumentValidationError createFromLibXmlError( $error )
Create from LibXmlError
Create a validation error object from a LibXmlError error object.

Parameters

Name Type Description
$error LibXMLError  

getOriginalError

mixed getOriginalError( )
Get original error object

__toString

void __toString( )
Convert libXML error to string

Last updated: Mon, 11 May 2009