Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
JsonApiRestController Class Reference

Rest JsonAPI implementation. More...

+ Inheritance diagram for JsonApiRestController:

Static Public Member Functions

static _getApiVersion ()
 Returns the api version.
 
static _getTemplateFile ()
 Returns the template for creating this type of controller.
 

Data Fields

const API_VERSION = 'JsonAPI 1.0'
 

Protected Member Functions

 getRestServer ()
 
 getRequestFormatter ()
 To override, returns the active formatter for the request.
 
- Protected Member Functions inherited from RestBaseController
 checkPermissions ($action, $datas=null)
 To override in derived classes.
 
 requireAuth ($action)
 Returns true if $action require an authentification with token.
 
 refreshToken ()
 Refresh an active token.
 
- Protected Member Functions inherited from RestControllerUtilitiesTrait
 getDatas ()
 
 getRequestParam ($param, $default)
 
 operate_ ($instance, $callback, $status, $exceptionMessage, $keyValues)
 
 generatePagination (&$filter, $pageNumber, $pageSize)
 
 updateOperation ($instance, $datas, $updateMany=false)
 
 addOperation ($instance, $datas, $insertMany=false)
 
 _getResponseFormatter ()
 
 getResponseFormatter ()
 To override, returns the active formatter for the response.
 
 _getRequestFormatter ()
 
 _getRestServer ()
 
 _setValuesToObject ($instance, $values=[])
 Updates $instance with $values To eventually be redefined in derived classes.
 
 updateManyToOne ($manyToOneRelations, $members, $className, $instance, $values)
 
 getInclude ($include)
 
 addError ($code, $title, $detail=null, $source=null, $status=null)
 
 hasErrors ()
 
 displayErrors ()
 
 getAssociatedMemberValues_ ($ids, $getDatas, $member, $include=false, $useCache=false, $multiple=true)
 
 addViolation (ConstraintViolation $violation)
 
 getPrimaryKeysFromDatas ($datas, $model)
 
 getCondition ($condition)
 
- Protected Member Functions inherited from DynamicResourceTrait
 _getResponseFormatter ()
 
 getRequestParam ($param, $default)
 
 hasErrors ()
 
 displayErrors ()
 
 updateOperation ($instance, $datas, $updateMany=false)
 
 addOperation ($instance, $datas, $insertMany=false)
 
 _setResource ($resource)
 
 _checkResource ($resource, $callback)
 

Additional Inherited Members

- Public Member Functions inherited from RestBaseController
 __construct ()
 Constructor initialize $view variable.
 
 index ()
 Default action.
 
 isValid ($action)
 Returns True if access to the controller is allowed To be override in sub classes.
 
 onInvalidControl ()
 Called if isValid () returns false To be override in sub classes.
 
 connect ()
 Realize the connection to the server.
 
 initialize ()
 Method called before each action Can be override in derived class.
 
 finalize ()
 Method called after each action Can be override in derived class.
 
 _errorHandler ($e)
 
 _setResponseCode ($value)
 
 _get ($condition='1=1', $include=false, $useCache=false)
 Returns a list of objects from the server.
 
 _getAll ()
 Returns all the instances from the model $resource.
 
 _getOne ($keyValues, $include=false, $useCache=false)
 Get the first object corresponding to the $keyValues.
 
 _format ($arrayMessage)
 
 _getManyToOne ($ids, $member, $include=false, $useCache=false)
 
 _getOneToMany ($ids, $member, $include=false, $useCache=false)
 
 _getManyToMany ($ids, $member, $include=false, $useCache=false)
 
 _update (... $keyValues)
 Update an instance of $model selected by the primary key $keyValues Require members values in $_POST array.
 
 _add ()
 Insert a new instance of $model Require members values in $_POST array.
 
 _getRelationShip ($id, $member)
 Returns an associated member value(s).
 
 _delete (... $keyValues)
 Delete the instance of $model selected by the primary key $keyValues.
 
- Public Member Functions inherited from Controller
 loadView (string $viewName, $pData=null, bool $asString=false)
 Loads the view $viewName possibly passing the variables $pdata.
 
 loadDefaultView ($pData=null, bool $asString=false)
 Loads the default view (controllerName/actionName) possibly passing the variables $pdata.
 
 getDefaultViewName ()
 Returns the default view name for this controller/action i.e ControllerName/actionName.html for the action actionName in ControllerName If there is an activeTheme @activeTheme/ControllerName/actionName.html
 
 forward (string $controller, string $action='index', $params=[], bool $initialize=false, bool $finalize=false)
 Loads the controller $controller and calls its $action method by passing the parameters $params.
 
 redirectToRoute (string $routeName, $parameters=[], bool $initialize=false, bool $finalize=false)
 Redirect to a route by its name.
 
 getView ()
 Returns the associated view instance.
 
- Public Member Functions inherited from RestControllerUtilitiesTrait
 _validateInstance ($instance, $members, $excludedValidators=[])
 
- Public Member Functions inherited from DynamicResourceTrait
 _setResponseCode ($value)
 
 _format ($arrayMessage)
 
 _getAll ()
 
 _getRelationShip ($id, $member)
 
 _getOne ($keyValues, $include=false, $useCache=false)
 
 _delete (... $keyValues)
 
 getAll_ ($resource)
 Returns all the instances from the model $resource.
 
 getRelationShip_ ($resource, $id, $member)
 Returns an associated member value(s).
 
 getOne_ ($resource, $id)
 Returns an instance of $resource, by primary key $id.
 
 add_ ($resource)
 Inserts a new instance of $resource.
 
 update_ ($resource,... $id)
 Updates an existing instance of $resource.
 
 delete_ ($resource,... $id)
 Deletes an existing instance of $resource.
 
- Protected Attributes inherited from RestBaseController
 $config
 
 $model
 
 $contentType
 
 $restCache
 
 $useValidation = true
 
 $responseFormatter
 
 $requestFormatter
 
 $server
 
- Protected Attributes inherited from Controller
View $view
 
- Protected Attributes inherited from RestControllerUtilitiesTrait
 $errors
 

Detailed Description

Rest JsonAPI implementation.

Ubiquity\controllers\rest\api\jsonapi$JsonApiRestController This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.1.3
Since
Ubiquity 2.0.11

Definition at line 25 of file JsonApiRestController.php.

Member Function Documentation

◆ _getApiVersion()

static _getApiVersion ( )
static

Returns the api version.

Returns
string

Reimplemented from RestBaseController.

Definition at line 45 of file JsonApiRestController.php.

◆ _getTemplateFile()

static _getTemplateFile ( )
static

Returns the template for creating this type of controller.

Returns
string

Reimplemented from RestBaseController.

Definition at line 54 of file JsonApiRestController.php.

◆ getRequestFormatter()

getRequestFormatter ( )
protected

To override, returns the active formatter for the request.

Returns
\Ubiquity\controllers\rest\formatters\RequestFormatter

Reimplemented from RestControllerUtilitiesTrait.

Definition at line 36 of file JsonApiRestController.php.

◆ getRestServer()

getRestServer ( )
protected
Returns
RestServer

Reimplemented from RestControllerUtilitiesTrait.

Definition at line 32 of file JsonApiRestController.php.

Field Documentation

◆ API_VERSION

const API_VERSION = 'JsonAPI 1.0'

Definition at line 26 of file JsonApiRestController.php.


The documentation for this class was generated from the following file: