## Zend_Rest_Server

Description

Implements interfaces:

- Zend_Server_Interface

- version: $Id: Abstract.php 3452 2007-02-15 18:14:15Z matthew $
- license: New BSD License
- copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Rest/Server.php (line 49)

    Zend_Server_Abstract
       |
       --Zend_Rest_Server

Variable Summary
mixed $_args
array $_functions
array $_headers
string $_method
Zend_Server_Reflection $_reflection
boolean $_returnResponse
Method Summary
Zend_Rest_Server __construct ()
void addFunction (string $function, [string $namespace = ''])
DOMDocument fault ([ $exception = null], [int $code = null], string|Exception $fault)
array getFunctions ()
array getHeaders ()
void handle ([array $request = false])
void loadFunctions (array $functions)
boolean|Zend_Rest_Server returnResponse ([boolean $flag = null])
void setClass (string $classname, [string $namespace = ''], [array $argv = array()])
void setPersistence (int $mode)
string _handleScalar (string|int|boolean $value)
string _handleStruct (array|object $struct)
void _structValue (mixed $struct, $dom, $parent)
Variables
mixed $_args = array() (line 59)

Class Constructor Args

- access: protected

array $_functions = array() (line 64)

- var: An array of Zend_Server_Reflect_Method
- access: protected

array $_headers = array() (line 69)

- var: Array of headers to send
- access: protected

string $_method (line 74)

- var: Current Method
- access: protected

Zend_Server_Reflection $_reflection = null (line 54)

- access: protected

boolean $_returnResponse = false (line 80)

Whether or not handle() should send output or return the response.

- var: Defaults to false
- access: protected

#### Inherited Variables

Inherited from Zend_Server_Abstract

> Zend_Server_Abstract::$magic_methods

Methods
Constructor __construct (line 85)

Constructor

- access: public

Zend_Rest_Server __construct ()
addFunction (line 450)

Implement Zend_Server_Interface::addFunction()

- access: public

void addFunction (string $function, [string $namespace = ''])

- string $function: Function Name
- string $namespace: Function namespace (unused)

fault (line 373)

Implement Zend_Server_Interface::fault()

Creates XML error response, returning DOMDocument with response.

- access: public

DOMDocument fault ([ $exception = null], [int $code = null], string|Exception $fault)

- string|Exception $fault: Message
- int $code: Error Code
- $exception

getFunctions (line 470)

Implement Zend_Server_Interface::getFunctions()

- return: An array of Zend_Server_Reflection_Method's
- access: public

array getFunctions ()
getHeaders (line 439)

Retrieve any HTTP extra headers set by the server

- access: public

array getHeaders ()
handle (line 118)

Implement Zend_Server_Interface::handle()

- access: public

void handle ([array $request = false])

- array $request

loadFunctions (line 481)

Implement Zend_Server_Interface::loadFunctions()

- access: public
- todo: Implement

void loadFunctions (array $functions)

- array $functions

returnResponse (line 103)

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.

- return: Returns Zend_Rest_Server when used to set the flag; returns boolean flag value otherwise.
- access: public

boolean|Zend_Rest_Server returnResponse ([boolean $flag = null])

- boolean $flag

setClass (line 231)

Implement Zend_Server_Interface::setClass()

- access: public

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

- string $classname: Class name
- string $namespace: Class namespace (unused)
- array $argv: An array of Constructor Arguments

setPersistence (line 491)

Implement Zend_Server_Interface::setPersistence()

- access: public
- todo: Implement

void setPersistence (int $mode)

- int $mode

_handleScalar (line 323)

Handle a single value

- return: XML Response
- access: protected

string _handleScalar (string|int|boolean $value)

- string|int|boolean $value: Result value

_handleStruct (line 245)

Handle an array or object result

- return: XML Response
- access: protected

string _handleStruct (array|object $struct)

- array|object $struct: Result Value

_structValue (line 291)

Recursively iterate through a struct

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

- access: protected

void _structValue (mixed $struct, $dom, $parent)

- mixed $struct
- DOMDocument $dom
- DOMElement $parent

#### Inherited Methods

Inherited From Zend_Server_Abstract

> Zend_Server_Abstract::lowerCase()

Documentation generated on Wed, 21 Feb 2007 11:59:39 -0800 by phpDocumentor 1.3.1