Zend Framework  3.0
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Fault Class Reference

XMLRPC Server Faults. More...

Public Member Functions

 __construct (\Exception $e)
 Constructor.
 
 getException ()
 Retrieve the exception.
 
- Public Member Functions inherited from Fault
 __construct ($code=404, $message= '')
 Constructor.
 
 setCode ($code)
 Set the fault code.
 
 getCode ()
 Return fault code.
 
 setMessage ($message)
 Retrieve fault message.
 
 getMessage ()
 Retrieve fault message.
 
 setEncoding ($encoding)
 Set encoding to use in fault response.
 
 getEncoding ()
 Retrieve current fault encoding.
 
 loadXml ($fault)
 Load an XMLRPC fault from XML.
 
 saveXml ()
 Serialize fault to XML.
 
 __toString ()
 Return XML fault response.
 

Static Public Member Functions

static getInstance (\Exception $e)
 Return Zend instance.
 
static attachFaultException ($classes)
 Attach valid exceptions that can be used to define xmlrpc faults.
 
static detachFaultException ($classes)
 Detach fault exception classes.
 
static attachObserver ($class)
 Attach an observer class.
 
static detachObserver ($class)
 Detach an observer.
 
- Static Public Member Functions inherited from Fault
static isFault ($xml)
 Determine if an XML response is an XMLRPC fault.
 

Protected Attributes

 $exception
 
- Protected Attributes inherited from Fault
 $code
 
 $encoding = 'UTF-8'
 
 $message
 
 $internal
 

Static Protected Attributes

static $faultExceptionClasses = ['Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface' => true]
 
static $observers = []
 

Detailed Description

XMLRPC Server Faults.

Encapsulates an exception for use as an XMLRPC fault response. Valid exception classes that may be used for generating the fault code and fault string can be attached using attachFaultException(); all others use a generic '404 Unknown error' response.

You may also attach fault observers, which would allow you to monitor particular fault cases; this is done via attachObserver(). Observers need only implement a static 'observe' method.

To allow method chaining, you may use the getInstance() factory to instantiate a Zend.

Constructor & Destructor Documentation

__construct ( \Exception  $e)

Constructor.

Parameters
\Exception$e
Returns
Fault

Member Function Documentation

static attachFaultException (   $classes)
static

Attach valid exceptions that can be used to define xmlrpc faults.

Parameters
string | array$classesClass name or array of class names
Returns
void
static attachObserver (   $class)
static

Attach an observer class.

Allows observation of xmlrpc server faults, thus allowing logging or mail notification of fault responses on the xmlrpc server.

Expects a valid class name; that class must have a public static method 'observe' that accepts an exception as its sole argument.

Parameters
string$class
Returns
bool
static detachFaultException (   $classes)
static

Detach fault exception classes.

Parameters
string | array$classesClass name or array of class names
Returns
void
static detachObserver (   $class)
static

Detach an observer.

Parameters
string$class
Returns
bool
getException ( )

Retrieve the exception.

public

Returns
static getInstance ( \Exception  $e)
static

Return Zend instance.

Parameters
\Exception$e
Returns
Fault

Member Data Documentation

$exception
protected
$faultExceptionClasses = ['Zend\\XmlRpc\\Server\\Exception\\ExceptionInterface' => true]
staticprotected
$observers = []
staticprotected