Rest/Server.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 [email protected] 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$  

\Zend_Rest_Server

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

>VPropertyprotectedarray $_args = array()
Class Constructor Args
Default valuearray()Details
Type
array
>VPropertyprotectedstring $_encoding = 'UTF-8'

Encoding

Default value'UTF-8'Details
Type
string
>VPropertyprotectedarray $_functions = array()

An array of Zend_Server_Reflect_Method

Default valuearray()Details
Type
array
>VPropertyprotectedarray $_headers = array()

Array of headers to send

Default valuearray()Details
Type
array
>VPropertyprotectedstring $_method

Current Method

Details
Type
string
>VPropertyprotected\Zend_Server_Reflection $_reflection = null
Default valuenullDetails
Type
\Zend_Server_Reflection
>VPropertyprotectedboolean $_returnResponse = false
Whether or not {@link handle()} should send output or return the response.
Default valuefalseDetails
Type
boolean
>VPropertyprotectedarray $magicMethods = array('__construct', '__destruct', '__get', '__set', '__call', '__sleep', '__wakeup', '__isset', '__unset', '__tostring', '__clone', '__set_state')
static

PHP'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

methodpublic__construct() : void

Constructor

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

Call an instance method of an object

Parameters
NameTypeDescription
$classstring
$argsarray
Returns
TypeDescription
mixed
Throws
ExceptionDescription
\Zend_Rest_Server_ExceptionFor invalid class name
methodprotected_callStaticMethod(string $class, array $args) : mixed

Call a static class method and return the result

Parameters
NameTypeDescription
$classstring
$argsarray
Returns
TypeDescription
mixed
methodprotected_handleScalar(string | int | boolean $value) : string

Handle a single value

Parameters
NameTypeDescription
$valuestring | int | boolean

Result value

Returns
TypeDescription
stringXML Response
methodprotected_handleStruct(array | object $struct) : string

Handle an array or object result

Parameters
NameTypeDescription
$structarray | object

Result Value

Returns
TypeDescription
stringXML Response
methodprotected_structValue(mixed $struct, \DOMDocument $dom, \DOMElement $parent) : void

Recursively iterate through a struct

Recursively iterates through an associative array or object's properties to build XML response.
Parameters
NameTypeDescription
$structmixed
$dom\DOMDocument
$parent\DOMElement
methodpublicaddFunction(string $function, string $namespace = '') : void

Implement Zend_Server_Interface::addFunction()

Parameters
NameTypeDescription
$functionstring

Function Name

$namespacestring

Function namespace (unused)

methodpublicfault( $exception = null, int $code = null) : \DOMDocument

Implement Zend_Server_Interface::fault()

Creates XML error response, returning DOMDocument with response.
Parameters
NameTypeDescription
$exception
$codeint

Error Code

Returns
TypeDescription
\DOMDocument
methodpublicgetEncoding() : string

Get XML encoding

Returns
TypeDescription
string
methodpublicgetFunctions() : array

Implement Zend_Server_Interface::getFunctions()

Returns
TypeDescription
arrayAn array of Zend_Server_Reflection_Method's
methodpublicgetHeaders() : array

Retrieve any HTTP extra headers set by the server

Returns
TypeDescription
array
methodpublichandle(array $request = false) : string | void

Implement Zend_Server_Interface::handle()

Parameters
NameTypeDescription
$requestarray
Returns
TypeDescription
string | void
Throws
ExceptionDescription
\Zend_Rest_Server_Exception
methodpublicloadFunctions(array $functions) : void

Implement Zend_Server_Interface::loadFunctions()

Parameters
NameTypeDescription
$functionsarray
Details
Todo
Implement  
methodpubliclowerCase(string $value, string $key) : string
static

Lowercase a string

Lowercase's a string by reference
Parameters
NameTypeDescription
$valuestring
$keystring
Returns
TypeDescription
stringLower cased string
methodpublicreturnResponse(boolean $flag = null) : boolean | \Zend_Rest_Server

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, {@link handle()} will not send output, but will instead return the response from the dispatched function/method.
Parameters
NameTypeDescription
$flagboolean
Returns
TypeDescription
boolean | \Zend_Rest_ServerReturns Zend_Rest_Server when used to set the flag; returns boolean flag value otherwise.
methodpublicsetClass(string $classname, string $namespace = '', array $argv = array()) : void

Implement Zend_Server_Interface::setClass()

Parameters
NameTypeDescription
$classnamestring

Class name

$namespacestring

Class namespace (unused)

$argvarray

An array of Constructor Arguments

methodpublicsetEncoding(string $encoding) : \Zend_Rest_Server

Set XML encoding

Parameters
NameTypeDescription
$encodingstring
Returns
TypeDescription
\Zend_Rest_Server
methodpublicsetPersistence(int $mode) : void

Implement Zend_Server_Interface::setPersistence()

Parameters
NameTypeDescription
$modeint
Details
Todo
Implement  
Documentation was generated by phpDocumentor 2.2.0 .