Class ApiController

Description

API controller is used for handling API requests

  • version: 1.0
  • abstract:

Located in /environment/classes/controller/ApiController.class.php (line 9)

Controller
   |
   --ApiController
Class Constant Summary
 RESPONSE_JSON = 'application/json'
 RESPONSE_XML = 'application/xml'
Method Summary
null error (integer $code)
null response ([mixed $objects = null], [string $format = null])
Methods
Constructor __construct (line 22)

Construct the ApiController

  • access: public
ApiController __construct (void 0)
  • void 0

Redefinition of:
Controller::__construct()
Contruct controller and set controller name
error (line 74)

Return HTTP error

null error (integer $code)
  • integer $code: Error code
response (line 64)

Return response if specified format.

$objects can be:

  • single DataObject. Sample response for ProjectTask object:
<response status="ok" format="text/xml"> <object class="ProjectTask"> <id type="integer">12</id> <text type="string">...</id> ... </object> </response>

  • array of DataObjects. Sample response for array of ProjectTask objects:
<response status="ok" format="text/xml"> <objects class="ProjectTask"> <object> <id type="integer">12</id> <text type="string">...</id> ... </object> </objects> </response>

  • NULL - Sample response
<response status="ok" format="text/xml"> </response>

null response ([mixed $objects = null], [string $format = null])
  • mixed $objects
  • string $format: If this value is NULL requested format is used. If NULL and format is not specified default format is used (self::RESPONSE_XML)

Inherited Methods

Inherited From Controller

Controller::__construct()
Controller::execute()
Controller::forward()
Controller::getAction()
Controller::getControllerName()
Controller::getSystemControllerClass()
Controller::setAction()
Controller::setControllerName()
Controller::setSystemControllerClass()
Controller::validAction()
Class Constants
RESPONSE_JSON = 'application/json' (line 13)
RESPONSE_XML = 'application/xml' (line 12)

Response types *

Documentation generated on Wed, 23 Jan 2008 01:57:38 +0000 by phpDocumentor 1.4.0