API Documentation

XmlRpc/Server/Fault.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_XmlRpc  
subpackage
Server  
version
$Id: Fault.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_XmlRpc_Server_Fault

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 {@link 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 {@link attachObserver()}. Observers need only implement a static 'observe' method.

To allow method chaining, you may use the {@link getInstance()} factory to instantiate a Zend_XmlRpc_Server_Fault.

Extends from
\Zend_XmlRpc_Fault
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_XmlRpc  
subpackage
Server  

Properties

Propertyprotected\Exception  $_exception= ''

Details
Type
\Exception
Propertyprotectedarray  $_faultExceptionClasses= 'array'
static

Array of exception classes that may define xmlrpc faults
Default valuearrayDetails
Type
array
Propertyprotectedarray  $_observers= 'array'
static

Array of fault observers
Default valuearrayDetails
Type
array

Methods

methodpublic__construct( \Exception $e ) : \Zend_XmlRpc_Server_Fault

Constructor

Parameters
Name Type Description
$e \Exception
Returns
Type Description
\Zend_XmlRpc_Server_Fault
methodpublic__toString( ) : string

Return XML fault response

Inherited from: \Zend_XmlRpc_Fault::__toString()
Returns
Type Description
string
methodpublicattachFaultException( string|array $classes ) : void
static

Attach valid exceptions that can be used to define xmlrpc faults

Parameters
Name Type Description
$classes string|array Class name or array of class names
methodpublicattachObserver( string $class ) : boolean
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
Name Type Description
$class string
Returns
Type Description
boolean
methodpublicdetachFaultException( string|array $classes ) : void
static

Detach fault exception classes

Parameters
Name Type Description
$classes string|array Class name or array of class names
methodpublicdetachObserver( string $class ) : boolean
static

Detach an observer

Parameters
Name Type Description
$class string
Returns
Type Description
boolean
methodpublicgetCode( ) : int

Return fault code

Inherited from: \Zend_XmlRpc_Fault::getCode()
Returns
Type Description
int
methodpublicgetEncoding( ) : string

Retrieve current fault encoding

Inherited from: \Zend_XmlRpc_Fault::getEncoding()
Returns
Type Description
string
methodpublicgetException( ) : \Exception

Retrieve the exception

Returns
Type Description
\Exception
Details
access
public  
methodpublicgetInstance( \Exception $e ) : \Zend_XmlRpc_Server_Fault
static

Return Zend_XmlRpc_Server_Fault instance

Parameters
Name Type Description
$e \Exception
Returns
Type Description
\Zend_XmlRpc_Server_Fault
methodpublicgetMessage( ) : string

Retrieve fault message

Inherited from: \Zend_XmlRpc_Fault::getMessage()
Returns
Type Description
string
methodpublicisFault( string $xml ) : boolean
static

Determine if an XML response is an XMLRPC fault

Inherited from: \Zend_XmlRpc_Fault::isFault()
Parameters
Name Type Description
$xml string
Returns
Type Description
boolean
methodpublicloadXml( string $fault ) : boolean

Load an XMLRPC fault from XML

Inherited from: \Zend_XmlRpc_Fault::loadXml()
Parameters
Name Type Description
$fault string
Returns
Type Description
boolean Returns true if successfully loaded fault response, false if response was not a fault response
Throws
Exception Description
\Zend_XmlRpc_Exception if no or faulty XML provided, or if fault response does not contain either code or message
methodpublicsaveXml( ) : string

Serialize fault to XML

Inherited from: \Zend_XmlRpc_Fault::saveXml()
Returns
Type Description
string
methodpublicsetCode( int $code ) : \Zend_XmlRpc_Fault

Set the fault code

Inherited from: \Zend_XmlRpc_Fault::setCode()
Parameters
Name Type Description
$code int
Returns
Type Description
\Zend_XmlRpc_Fault
methodpublicsetEncoding( string $encoding ) : \Zend_XmlRpc_Fault

Set encoding to use in fault response

Inherited from: \Zend_XmlRpc_Fault::setEncoding()
Parameters
Name Type Description
$encoding string
Returns
Type Description
\Zend_XmlRpc_Fault
methodpublicsetMessage(  $message ) : \Zend_XmlRpc_Fault

Retrieve fault message

Inherited from: \Zend_XmlRpc_Fault::setMessage()
Parameters
Name Type Description
$message string
Returns
Type Description
\Zend_XmlRpc_Fault
Documentation was generated by DocBlox 0.13.3.