Request handler class for Front End Controller.
This class will handle requests sent by Views and pass them to the correct LudoDBObject's. User: Alf Magne Kalleland Date: 13.01.13
package | LudoDB |
---|---|
author | Alf Magne Kalleland |
clearCacheObject()
handle($request) : string
router.template.php can be used as a template on how to create a controller for a request handler.
Example code:
require_once(dirname(__FILE__)."/autoload.php");
require_once("php/jsonwrapper/jsonwrapper.php");
date_default_timezone_set("Europe/Berlin");
if(file_exists("connection.php")){
require("connection.php");
}
LudoDBRegistry::set('DEVELOP_MODE', true);
LudoDB::enableLogging();
$request = array('request' => isset($_GET['request']) ? $_GET['request'] : $_POST['request']);
if(isset($_POST['data'])){
$request['data'] = isset($_POST['data']) ? $_POST['data'] : null;
}
if(isset($_POST['arguments'])){
$request['arguments'] = $_POST['arguments'];
}
$handler = new LudoDBRequestHandler();
echo $handler->handle($request);
\LudoDBObjectNotFoundException |
|
---|---|
\LudoDBServiceNotImplementedException |
|
\LudoDBInvalidServiceException |
|
\LudoDBInvalidArgumentsException |
string
getArguments(array $request) : array
array
array
getResource(array $request, array $args) : null | object
getServiceName($request) : mixed
mixed
getCached(array $requestData) : array
array
array
getClassName($request) : string | null
string
null
getParsed($request) : array
array
getValidServices(array $request) : array | mixed
array
array
mixed
toJSON(array $data) : string
array
string
$cacheInstance : \LudoDBCache
$resource : \LudoDBObject | \LudoDBService
$serviceName : string
$arguments : array
$code : int
$responseKey : string
$success : bool
$validServices : array