ZurmoModuleApiController Class Reference

Inheritance diagram for ZurmoModuleApiController:
ZurmoBaseController Controller AccountAccountAffiliationsAccountAccountAffiliationApiController AccountContactAffiliationsAccountContactAffiliationApiController ContactsContactStateApiController UsersUserApiController ZurmoApiController ZurmoCurrencyApiController ZurmoCustomFieldApiController ZurmoGroupApiController ZurmoPermissionApiController ZurmoRoleApiController ZurmoSecurableItemApiController

Public Member Functions

 filters ()
 filterApiRequest ($filterChain)
 actionRead ()
 actionList ()
 actionListAttributes ()
 actionSearch ()
 actionCreate ()
 actionUpdate ()
 actionDelete ()
 actionAddRelation ()
 actionRemoveRelation ()

Data Fields

const RIGHTS_FILTER_PATH = 'application.modules.api.utils.ApiRightsControllerFilter'

Protected Member Functions

 getModelName ()
 processRead ($id)
 processList ($params)
 processListAttributes ($params)
 processSearch ($params)
 getOffsetFromCurrentPageAndPageSize ($currentPage, $pageSize)
 processAddRelation ($params)
 processRemoveRelation ($params)
 processCreate ($data)
 processUpdate ($id, $data)
 manageModelRelations ($model, $modelRelations)
 processDelete ($id)
 attemptToSaveModelFromData ($model, $data, $redirectUrlParams=null, $redirect=true)
 preAttemptToSaveModelFromDataHook (RedBeanModel $model, array &$data)

Static Protected Member Functions

static getSearchFormClassName ()
static getModelToApiDataUtil ()
static getModelToApiDataUtilData (RedBeanModel $model)

Detailed Description

Zurmo Modules api controllers should extend this class to provide generic functionality that is applicable to all standard api modules.

Definition at line 42 of file ZurmoModuleApiController.php.


Member Function Documentation

actionRead (  ) 

Get model and send response

Exceptions:
ApiException 

Reimplemented in ZurmoCustomFieldApiController.

Definition at line 72 of file ZurmoModuleApiController.php.

actionList (  ) 

Get array or models and send response

Definition at line 87 of file ZurmoModuleApiController.php.

actionListAttributes (  ) 

Get array or models and send response

Definition at line 97 of file ZurmoModuleApiController.php.

actionSearch (  ) 

Get array or models and send response

Definition at line 107 of file ZurmoModuleApiController.php.

actionCreate (  ) 
actionDelete (  ) 
actionAddRelation (  ) 
actionRemoveRelation (  ) 
processRead ( id  )  [protected]

Get model by id

Parameters:
int $id
Exceptions:
ApiException 
Returns:
ApiResult

Reimplemented in ZurmoCustomFieldApiController.

Definition at line 196 of file ZurmoModuleApiController.php.

processList ( params  )  [protected]

List all models that satisfy provided criteria

Parameters:
array $params
Exceptions:
ApiException 
Returns:
ApiResult

Reimplemented in ZurmoCustomFieldApiController.

Definition at line 246 of file ZurmoModuleApiController.php.

processListAttributes ( params  )  [protected]

List all model attributes

Parameters:
$params 
Returns:
ApiResult
Exceptions:
ApiException 

Definition at line 368 of file ZurmoModuleApiController.php.

processSearch ( params  )  [protected]

Search and list all models that satisfy provided criteria

Parameters:
array $params
Exceptions:
ApiException 
Returns:
ApiResult

Definition at line 396 of file ZurmoModuleApiController.php.

getOffsetFromCurrentPageAndPageSize ( currentPage,
pageSize 
) [protected]
Parameters:
$currentPage 
$pageSize 
Returns:
integer || null

Definition at line 490 of file ZurmoModuleApiController.php.

processAddRelation ( params  )  [protected]

Add model relation

Parameters:
array $params
Exceptions:
ApiException 
Returns:
ApiResult

Definition at line 506 of file ZurmoModuleApiController.php.

processRemoveRelation ( params  )  [protected]

Remove model relation

Parameters:
array $params
Exceptions:
ApiException 
Returns:
ApiResult

Definition at line 558 of file ZurmoModuleApiController.php.

processCreate ( data  )  [protected]

Create new model

Parameters:
array $data
Exceptions:
ApiException 

Definition at line 608 of file ZurmoModuleApiController.php.

processUpdate ( id,
data 
) [protected]

Update model

Parameters:
int $id
array $data
Exceptions:
ApiException 
Returns:
ApiResult

Reimplemented in OpportunitiesOpportunityApiController.

Definition at line 664 of file ZurmoModuleApiController.php.

manageModelRelations ( model,
modelRelations 
) [protected]
Parameters:
RedBeanModel $model
array $modelRelations
Exceptions:
NotSupportedException 
FailedToSaveModelException 
ApiException 

Definition at line 745 of file ZurmoModuleApiController.php.

processDelete ( id  )  [protected]

Delete model

Parameters:
int $id
Exceptions:
ApiException 
Returns:
ApiResult

Definition at line 807 of file ZurmoModuleApiController.php.

attemptToSaveModelFromData ( model,
data,
redirectUrlParams = null,
redirect = true 
) [protected]

Instead of saving from post, we are saving from the API data.

See also:
attemptToSaveModelFromPost

Definition at line 849 of file ZurmoModuleApiController.php.

preAttemptToSaveModelFromDataHook ( RedBeanModel model,
array &$  data 
) [protected]

Hook to alter $model or $data before we attempt to save it.

Parameters:
RedBeanModel $model
array $data

Reimplemented in ZurmoSecurableItemApiController.

Definition at line 875 of file ZurmoModuleApiController.php.

static getModelToApiDataUtil (  )  [static, protected]

Util used to convert model to array

Returns:
string

Reimplemented in ZurmoSecurableItemApiController.

Definition at line 883 of file ZurmoModuleApiController.php.

static getModelToApiDataUtilData ( RedBeanModel model  )  [static, protected]

Returns data array for provided model using getModelToApiDataUtil

Parameters:
RedBeanModel $model
Returns:
array

Definition at line 893 of file ZurmoModuleApiController.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Thu Aug 17 07:10:32 2017