Ubiquity
2.0.3
php rapid development framework
|
Public Member Functions | |
__construct () | |
isValid ($action) | |
onInvalidControl () | |
connect () | |
Realise the connection to the server To override in derived classes to define your own authentication. More... | |
initialize () | |
finalize () | |
_errorHandler ($e) | |
_setResponseCode ($value) | |
index () | |
Returns all objects for the resource $model ("cache"=>false) More... | |
getById ($id) | |
Default route for requiring a single object ("{id}","methods"=>["get","options"]) More... | |
get ($condition="1=1", $loadManyToOne=false, $loadOneToMany=false, $useCache=false) | |
Returns a list of objects from the server. More... | |
getOne ($keyValues, $loadManyToOne=false, $loadOneToMany=false, $useCache=false) | |
Get the first object corresponding to the $keyValues. More... | |
_format ($arrayMessage) | |
getOneToMany ($member, $useCache=false) | |
getManyToMany ($member, $useCache=false) | |
update (... $keyValues) | |
Update an instance of $model selected by the primary key $keyValues Require members values in $_POST array. More... | |
add () | |
Insert a new instance of $model Require members values in $_POST array . More... | |
delete (... $keyValues) | |
Delete the instance of $model selected by the primary key $keyValues Requires an authorization with access token. More... | |
![]() | |
index () | |
Default action. More... | |
__construct () | |
Constructor initialize $view variable. More... | |
initialize () | |
Method called before each action Can be override in derived class. More... | |
finalize () | |
Method called after each action Can be override in derived class. More... | |
loadView ($viewName, $pData=NULL, $asString=false) | |
Loads the view $viewName possibly passing the variables $pdata. More... | |
loadDefaultView ($pData=NULL, $asString=false) | |
Loads the default view (controllerName/actionName) possibly passing the variables $pdata. More... | |
getDefaultViewName () | |
Returns the default view name for this controller/action i.e ControllerName/actionName.html for the action actionName in ControllerName. More... | |
isValid ($action) | |
Returns True if access to the controller is allowed To be override in sub classes. More... | |
onInvalidControl () | |
Called if isValid () returns false To be override in sub classes. More... | |
forward ($controller, $action="index", $params=array(), $initialize=false, $finalize=false) | |
Loads the controller $controller and calls its $action method by passing the parameters $params. More... | |
redirectToRoute ($routeName, $parameters=[], $initialize=false, $finalize=false) | |
Redirect to a route by its name. More... | |
getView () | |
Protected Member Functions | |
connectDb ($config) | |
_setValuesToObject ($instance, $values=null) | |
Updates $instance with $values To eventually be redefined in derived classes. More... | |
Protected Attributes | |
$config | |
$model | |
$contentType | |
$restCache | |
$responseFormatter | |
$server | |
![]() | |
$view | |
Definition at line 17 of file RestController.php.
__construct | ( | ) |
Definition at line 32 of file RestController.php.
_errorHandler | ( | $e | ) |
Definition at line 86 of file RestController.php.
_format | ( | $arrayMessage | ) |
Definition at line 179 of file RestController.php.
_setResponseCode | ( | $value | ) |
Definition at line 94 of file RestController.php.
|
protected |
Updates $instance with $values To eventually be redefined in derived classes.
object | $instance | the instance to update |
array | null | $values |
Definition at line 111 of file RestController.php.
add | ( | ) |
Insert a new instance of $model Require members values in $_POST array .
Definition at line 240 of file RestController.php.
connect | ( | ) |
Realise the connection to the server To override in derived classes to define your own authentication.
Definition at line 64 of file RestController.php.
|
protected |
Definition at line 98 of file RestController.php.
delete | ( | $keyValues | ) |
Delete the instance of $model selected by the primary key $keyValues Requires an authorization with access token.
array | $keyValues | ("methods"=>["delete"]) |
Definition at line 264 of file RestController.php.
finalize | ( | ) |
Definition at line 79 of file RestController.php.
get | ( | $condition = "1=1" , |
|
$loadManyToOne = false , |
|||
$loadOneToMany = false , |
|||
$useCache = false |
|||
) |
Returns a list of objects from the server.
string | $condition | the sql Where part |
boolean | $loadManyToOne | |
boolean | $loadOneToMany | |
boolean | $useCache |
Definition at line 142 of file RestController.php.
getById | ( | $id | ) |
Default route for requiring a single object ("{id}","methods"=>["get","options"])
Definition at line 131 of file RestController.php.
getManyToMany | ( | $member, | |
$useCache = false |
|||
) |
string | $member | |
boolean | $useCache |
Definition at line 203 of file RestController.php.
getOne | ( | $keyValues, | |
$loadManyToOne = false , |
|||
$loadOneToMany = false , |
|||
$useCache = false |
|||
) |
Get the first object corresponding to the $keyValues.
string | $keyValues | primary key(s) value(s) or condition |
boolean | $loadManyToOne | if true then manyToOne members are loaded. |
boolean | $loadOneToMany | if true then oneToMany members are loaded. |
boolean | $useCache | if true then response is cached |
Definition at line 163 of file RestController.php.
getOneToMany | ( | $member, | |
$useCache = false |
|||
) |
string | $member | |
boolean | $useCache |
Definition at line 188 of file RestController.php.
index | ( | ) |
Returns all objects for the resource $model ("cache"=>false)
Definition at line 122 of file RestController.php.
initialize | ( | ) |
Definition at line 68 of file RestController.php.
isValid | ( | $action | ) |
Definition at line 47 of file RestController.php.
onInvalidControl | ( | ) |
Definition at line 56 of file RestController.php.
update | ( | $keyValues | ) |
Update an instance of $model selected by the primary key $keyValues Require members values in $_POST array.
array | $keyValues |
Definition at line 219 of file RestController.php.
|
protected |
Definition at line 18 of file RestController.php.
|
protected |
Definition at line 20 of file RestController.php.
|
protected |
Definition at line 19 of file RestController.php.
|
protected |
Definition at line 25 of file RestController.php.
|
protected |
Definition at line 21 of file RestController.php.
|
protected |
Definition at line 30 of file RestController.php.