Rest/Server.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-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Rest
- Subpackage
- Server
- Version
- $Id$
Package: Zend_Rest\Server- Implements
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties



array $_functions = array()An array of Zend_Server_Reflect_Method
Default valuearray()Details- Type
- array



boolean $_returnResponse = falseWhether or not {@link handle()} should send output or return the response.
Default valuefalseDetails- Type
- boolean



array $magicMethods = array('__construct', '__destruct', '__get', '__set', '__call', '__sleep', '__wakeup', '__isset', '__unset', '__tostring', '__clone', '__set_state')staticPHP's Magic Methods, these are ignored
Default valuearray('__construct', '__destruct', '__get', '__set', '__call', '__sleep', '__wakeup', '__isset', '__unset', '__tostring', '__clone', '__set_state')Details- Type
- array
Methods



_callObjectMethod(string $class, array $args) : mixedCall an instance method of an object
Parameters| Name | Type | Description |
|---|
| $class | string | |
|---|
| $args | array | |
|---|
ReturnsThrows 


_callStaticMethod(string $class, array $args) : mixedCall a static class method and return the result
Parameters| Name | Type | Description |
|---|
| $class | string | |
|---|
| $args | array | |
|---|
Returns 


_handleScalar(string | int | boolean $value) : stringParameters| Name | Type | Description |
|---|
| $value | string | int | boolean | Result value |
|---|
Returns| Type | Description |
|---|
| string | XML Response |



_handleStruct(array | object $struct) : stringHandle an array or object result
Parameters| Name | Type | Description |
|---|
| $struct | array | object | Result Value |
|---|
Returns| Type | Description |
|---|
| string | XML Response |



_structValue(mixed $struct, \DOMDocument $dom, \DOMElement $parent) : voidRecursively iterate through a struct
Recursively iterates through an associative array or object's properties
to build XML response.
Parameters


addFunction(string $function, string $namespace = '') : voidImplement Zend_Server_Interface::addFunction()
Parameters| Name | Type | Description |
|---|
| $function | string | Function Name |
|---|
| $namespace | string | Function namespace (unused) |
|---|



fault( $exception = null, int $code = null) : \DOMDocumentImplement Zend_Server_Interface::fault()
Creates XML error response, returning DOMDocument with response.
Parameters| Name | Type | Description |
|---|
| $exception | | |
|---|
| $code | int | Error Code |
|---|
Returns


getFunctions() : arrayImplement Zend_Server_Interface::getFunctions()
Returns| Type | Description |
|---|
| array | An array of Zend_Server_Reflection_Method's |



handle(array $request = false) : string | voidImplement Zend_Server_Interface::handle()
Parameters| Name | Type | Description |
|---|
| $request | array | |
|---|
Returns| Type | Description |
|---|
| string | void | |
Throws 


loadFunctions(array $functions) : voidImplement Zend_Server_Interface::loadFunctions()
Parameters| Name | Type | Description |
|---|
| $functions | array | |
|---|
Details- Todo
- Implement



returnResponse(boolean $flag = null) : boolean | \Zend_Rest_ServerWhether 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, {@link handle()} will not send output,
but will instead return the response from the dispatched function/method.
Parameters| Name | Type | Description |
|---|
| $flag | boolean | |
|---|
Returns| Type | Description |
|---|
| boolean | \Zend_Rest_Server | Returns Zend_Rest_Server when used to set the flag; returns boolean flag value otherwise. |



setClass(string $classname, string $namespace = '', array $argv = array()) : voidImplement Zend_Server_Interface::setClass()
Parameters| Name | Type | Description |
|---|
| $classname | string | Class name |
|---|
| $namespace | string | Class namespace (unused) |
|---|
| $argv | array | An array of Constructor Arguments |
|---|



setPersistence(int $mode) : voidImplement Zend_Server_Interface::setPersistence()
Parameters| Name | Type | Description |
|---|
| $mode | int | |
|---|
Details- Todo
- Implement