category Zend
package Zend_Rest
subpackage Server
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Constructor

__construct() 

Implement Zend_Server_Interface::addFunction()

addFunction(string $function, string $namespace = ''

Namespacing is primarily for xmlrpc, but may be used with other implementations to prevent naming collisions.

inherited_from \Zend_Server_Interface::addFunction()

Parameters

$function

string

Function Name

$namespace

string

Function namespace (unused)

Implement Zend_Server_Interface::fault()

fault($exception = null, integer $code = null) : \DOMDocument

Creates XML error response, returning DOMDocument with response.

inherited_from \Zend_Server_Interface::fault()

Parameters

$exception

$code

integer

Error Code

Returns

\DOMDocument

Get XML encoding

getEncoding() : string

Returns

string

Implement Zend_Server_Interface::getFunctions()

getFunctions() : array

Returns a server definition array as created using *. Can be used for server introspection, documentation, or persistence.

inherited_from \Zend_Server_Interface::getFunctions()

Returns

arrayAn array of Zend_Server_Reflection_Method's

Retrieve any HTTP extra headers set by the server

getHeaders() : array

Returns

array

Implement Zend_Server_Interface::handle()

handle(array $request = false) : string | void

Requests may be passed in, or the server may automagically determine the request based on defaults. Dispatches server request to appropriate method and returns a response

inherited_from \Zend_Server_Interface::handle()

Parameters

$request

array

Exceptions

\Zend_Rest_Server_Exception

Returns

stringvoid

Implement Zend_Server_Interface::loadFunctions()

loadFunctions(array $functions) 

Used for persistence; loads a construct as returned by \getFunctions().

todo Implement
inherited_from \Zend_Server_Interface::loadFunctions()

Parameters

$functions

array

Lowercase a string

lowerCase(string $value, string $key) : string
Static

Lowercase's a string by reference

Parameters

$value

string

$key

string

Returns

stringLower cased string

Whether or not to return a response

returnResponse(boolean $flag = null) : boolean | \Zend_Rest_Server

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

$flag

boolean

Returns

boolean\Zend_Rest_ServerReturns Zend_Rest_Server when used to set the flag; returns boolean flag value otherwise.

Implement Zend_Server_Interface::setClass()

setClass(string $classname, string $namespace = '', array $argv = array()

The individual implementations should probably allow passing a variable number of arguments in, so that developers may define custom runtime arguments to pass to server methods.

Namespacing is primarily for xmlrpc, but could be used for other implementations as well.

inherited_from \Zend_Server_Interface::setClass()

Parameters

$classname

string

Class name

$namespace

string

Class namespace (unused)

$argv

array

An array of Constructor Arguments

Set XML encoding

setEncoding(string $encoding) : \Zend_Rest_Server

Parameters

$encoding

string

Returns

\Zend_Rest_Server

Implement Zend_Server_Interface::setPersistence()

setPersistence(integer $mode) 
todo Implement
inherited_from \Zend_Server_Interface::setPersistence()

Parameters

$mode

integer

Call an instance method of an object

_callObjectMethod(string $class, array $args) : mixed

Parameters

$class

string

$args

array

Exceptions

\Zend_Rest_Server_Exception For invalid class name

Returns

mixed

Call a static class method and return the result

_callStaticMethod(string $class, array $args) : mixed

Parameters

$class

string

$args

array

Returns

mixed

Handle a single value

_handleScalar(string|integer|boolean $value) : string

Parameters

$value

stringintegerboolean

Result value

Returns

stringXML Response

Handle an array or object result

_handleStruct(array|object $struct) : string

Parameters

$struct

arrayobject

Result Value

Returns

stringXML Response

Recursively iterate through a struct

_structValue(mixed $struct, \DOMDocument $dom, \DOMElement $parent) : void

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

Parameters

$struct

mixed

$dom

\DOMDocument

$parent

\DOMElement

 Properties

 

Class Constructor Args

$_args : array

Default

array()
 

Encoding

$_encoding : string

Default

'UTF-8'
 

An array of Zend_Server_Reflect_Method

$_functions : array

Default

array()
 

Array of headers to send

$_headers : array

Default

array()
 

Current Method

$_method : string

Default

 

$_reflection

$_reflection : \Zend_Server_Reflection

Default

null
 

Whether or not {@link handle()} should send output or return the response.

$_returnResponse : boolean

Default

false
 

PHP's Magic Methods, these are ignored

$magicMethods : array

Default

array('__construct', '__destruct', '__get', '__set', '__call', '__sleep', '__wakeup', '__isset', '__unset', '__tostring', '__clone', '__set_state')
Static