Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Zend_Rest_Server Class Reference

Public Member Functions

 __construct ()
 Constructor.
 
 setEncoding ($encoding)
 Set XML encoding.
 
 getEncoding ()
 Get XML encoding.
 
 returnResponse ($flag=null)
 Whether or not to return a response.
 
 handle ($request=false)
 Implement Zend_Server_Interface::handle()
 
 setClass ($classname, $namespace= '', $argv=array())
 Implement Zend_Server_Interface::setClass()
 
 fault ($exception=null, $code=null)
 Implement Zend_Server_Interface::fault()
 
 getHeaders ()
 Retrieve any HTTP extra headers set by the server.
 
 addFunction ($function, $namespace= '')
 Implement Zend_Server_Interface::addFunction()
 
 getFunctions ()
 Implement Zend_Server_Interface::getFunctions()
 
 loadFunctions ($functions)
 Implement Zend_Server_Interface::loadFunctions()
 
 setPersistence ($mode)
 Implement Zend_Server_Interface::setPersistence()
 

Static Public Member Functions

static lowerCase (&$value, &$key)
 Lowercase a string.
 

Protected Member Functions

 _handleStruct ($struct)
 Handle an array or object result.
 
 _structValue ($struct, DOMDocument $dom, DOMElement $parent)
 Recursively iterate through a struct.
 
 _handleScalar ($value)
 Handle a single value.
 
 _callStaticMethod ($class, array $args)
 Call a static class method and return the result.
 
 _callObjectMethod ($class, array $args)
 Call an instance method of an object.
 

Protected Attributes

 $_args = array()
 
 $_encoding = 'UTF-8'
 
 $_functions = array()
 
 $_headers = array()
 
 $_method
 
 $_reflection = null
 
 $_returnResponse = false
 

Static Protected Attributes

static $magicMethods
 

Constructor & Destructor Documentation

__construct ( )

Constructor.

Member Function Documentation

_callObjectMethod (   $class,
array  $args 
)
protected

Call an instance method of an object.

Parameters
string$class
array$args
Returns
mixed
Exceptions
Zend_Rest_Server_ExceptionFor invalid class name
_callStaticMethod (   $class,
array  $args 
)
protected

Call a static class method and return the result.

Parameters
string$class
array$args
Returns
mixed
_handleScalar (   $value)
protected

Handle a single value.

Parameters
string | int | boolean$valueResult value
Returns
string XML Response
_handleStruct (   $struct)
protected

Handle an array or object result.

Parameters
array | object$structResult Value
Returns
string XML Response
_structValue (   $struct,
DOMDocument  $dom,
DOMElement  $parent 
)
protected

Recursively iterate through a struct.

Recursively iterates through an associative array or object's properties to build XML response.

Parameters
mixed$struct
DOMDocument$dom
DOMElement$parent
Returns
void
addFunction (   $function,
  $namespace = '' 
)

Implement Zend_Server_Interface::addFunction()

Parameters
string$functionFunction Name
string$namespaceFunction namespace (unused)

Implements Zend_Server_Interface.

fault (   $exception = null,
  $code = null 
)

Implement Zend_Server_Interface::fault()

Creates XML error response, returning DOMDocument with response.

Parameters
string | Exception$faultMessage
int$codeError Code
Returns
DOMDocument

Implements Zend_Server_Interface.

getEncoding ( )

Get XML encoding.

Returns
string
getFunctions ( )
getHeaders ( )

Retrieve any HTTP extra headers set by the server.

Returns
array
handle (   $request = false)

Implement Zend_Server_Interface::handle()

Parameters
array$request
Exceptions
Zend_Rest_Server_Exception
Returns
string|void

Implements Zend_Server_Interface.

loadFunctions (   $functions)

Implement Zend_Server_Interface::loadFunctions()

Todo:
Implement
Parameters
array$functions

Implements Zend_Server_Interface.

static lowerCase ( $value,
$key 
)
static

Lowercase a string.

Lowercase's a string by reference

Parameters
string$value
string$key
Returns
string Lower cased string
returnResponse (   $flag = null)

Whether or not to return a response.

If called without arguments, returns the value of the flag. If called with an argument, sets the flag.

When 'return response' is true, handle() will not send output, but will instead return the response from the dispatched function/method.

Parameters
boolean$flag
Returns
boolean|Zend_Rest_Server Returns Zend_Rest_Server when used to set the flag; returns boolean flag value otherwise.
setClass (   $classname,
  $namespace = '',
  $argv = array() 
)

Implement Zend_Server_Interface::setClass()

Parameters
string$classnameClass name
string$namespaceClass namespace (unused)
array$argvAn array of Constructor Arguments

Implements Zend_Server_Interface.

setEncoding (   $encoding)

Set XML encoding.

Parameters
string$encoding
Returns
Zend_Rest_Server
setPersistence (   $mode)

Implement Zend_Server_Interface::setPersistence()

Todo:
Implement
Parameters
int$mode

Implements Zend_Server_Interface.

Member Data Documentation

$_args = array()
protected
$_encoding = 'UTF-8'
protected
$_functions = array()
protected
$_headers = array()
protected
$_method
protected
$_reflection = null
protected
$_returnResponse = false
protected
$magicMethods
staticprotected
Initial value:
= array(
'__construct',
'__destruct',
'__get',
'__set',
'__call',
'__sleep',
'__wakeup',
'__isset',
'__unset',
'__tostring',
'__clone',
'__set_state',
)