JSON Interface to Contrexx Doctrine Database

api
copyright Comvation AG
author Florian Schuetz
author Michael Ritter
package contrexx
subpackage core_json

 Methods

Constructor, loads adapter classes

__construct() 

addAdapter()

addAdapter($className, $namespace) 
Static

Parameters

$className

$namespace

Passes JSON data to the particular adapter and returns the result Called from jsondata() or any part of Contrexx

data(String $adapter, String $method, Array $arguments) : String
author Michael Ritter

Parameters

$adapter

String

Adapter name

$method

String

Method name

$arguments

Array

Arguments to pass

Returns

Stringdata to use for further processing

Returns the JSON code for a error message

getErrorData(String $message) : String
author Michael Ritter

Parameters

$message

String

HTML encoded message

Returns

StringJSON code

Fetches a json response via HTTP request

getJson(string $url, array $data, boolean $secure, string $certificateFile) : mixed
todo Support cookies (to allow login and similiar features)

Parameters

$url

string

URL to get json from

$data

array

(optional) HTTP post data

$secure

boolean

(optional) Wheter to verify peer using SSL or not, default false

$certificateFile

string

(optional) Local certificate file for non public SSL certificates

Returns

mixedDecoded JSON on success, false otherwise

getSessionId()

getSessionId() 

Parses data into JSON

json(array $data, boolean $setContentType) : String

Parameters

$data

array

Data to JSONify

$setContentType

boolean

(optional) If true (NOT default) the content type is set to application/json

Returns

StringJSON data to return to client

Passes JSON data to the particular adapter and returns the result Called from index.php when section is 'jsondata'

jsondata(String $adapter, String $method, Array $arguments, boolean $setContentType) : String
author Florian Schuetz
author Michael Ritter

Parameters

$adapter

String

Adapter name

$method

String

Method name

$arguments

Array

Arguments to pass

$setContentType

boolean

(optional) If true (default) the content type is set to application/json

Returns

StringJSON data to return to client

Adds an adapter accessable by JSON requests.

loadAdapter(string $className, string $namespace) 

Either specify a fully qualified classname, or a classname and the containing namespace separatly

Parameters

$className

string

Fully qualified or class name located in $namespace

$namespace

string

(optional) Namespace for non fully qualified class name

setSessionId()

setSessionId($sessionId) 

Parameters

$sessionId

 Properties

 

$adapter_classes : array
deprecated Use component framework instead (SystemComponentController->getControllersAccessableByJson())
 

$adapters : Array
 

$sessionId : string
© Copyright 2013 by Comvation AG
Generated on 2013-12-23T08:13:39-08:00.