All Data Structures Functions Variables Pages
Public Member Functions | Data Fields | Protected Member Functions | Static Protected Member Functions
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 ()
 
 processGetModifiedItems ($params)
 
 processGetManyManyRelationshipModels ($params)
 
- Public Member Functions inherited from ZurmoBaseController
 filters ()
 
 resolveModuleClassNameForFilters ()
 
 __construct ($id, $module=null)
 
- Public Member Functions inherited from Controller
 __construct ($id, $module=null)
 
 resolveAndGetModuleId ()
 
 renderBeginWidget ($className, $properties=array())
 
 renderEndWidget ()
 
 makeRedBeanDataProviderByDataCollection ($searchModel, $pageSize, $stateMetadataAdapterClassName=null, $dataCollection=null)
 

Data Fields

const RIGHTS_FILTER_PATH = 'application.modules.api.utils.ApiRightsControllerFilter'
 
- Data Fields inherited from ZurmoBaseController
const RIGHTS_FILTER_PATH = 'application.modules.zurmo.controllers.filters.RightsControllerFilter'
 
const REQUIRED_ATTRIBUTES_FILTER_PATH = 'application.modules.zurmo.controllers.filters.RequiredAttributesControllerFilter'
 
const ADMIN_VIEW_MOBILE_CHECK_FILTER_PATH = 'application.modules.zurmo.controllers.filters.AdminViewMobileCheckControllerFilter'
 
const ROOT_USER_ACCESS_FILTER_PATH = 'application.modules.zurmo.controllers.filters.RootUserAccessControllerFilter'
 

Protected Member Functions

 getModelName ()
 
 processRead ($id)
 
 processList ($params)
 
 processListAttributes ($params)
 
 processSearch ($params)
 
 getOffsetFromCurrentPageAndPageSize ($currentPage, $pageSize)
 
 processAddRelation ($params)
 
 processRemoveRelation ($params)
 
 processCreate ($data)
 
 processUpdate ($id, $data)
 
 resolveModelScenario (array &$data)
 
 setModelScenarioFromData (RedBeanModel $model, array &$data)
 
 manageModelRelations ($model, $modelRelations)
 
 processDelete ($id)
 
 attemptToSaveModelFromData ($model, $data, $redirectUrlParams=null, $redirect=true)
 
 preAttemptToSaveModelFromDataHook (RedBeanModel $model, array &$data)
 
 resolveStateMetadataAdapterClassName ()
 
 processGetDeletedItems ($params)
 
 processGetCreatedItems ($params)
 
 checkPostSizeExceeded ()
 
- Protected Member Functions inherited from ZurmoBaseController
 makeActionBarSearchAndListView ($searchModel, $dataProvider, $actionBarViewClassName= 'SecuredActionBarForSearchAndListView', $viewPrefixName=null, $activeActionElementType=null, IntroView $introView=null)
 
 makeActionBarAndListView ($listModel, $dataProvider, $actionBarViewClassName= 'ActionBarForSearchAndListView', $viewPrefixName=null, $activeActionElementType=null)
 
 makeListView (SearchForm $searchForm, $dataProvider, $listViewClassName=null)
 
 resolveSearchDataProvider ($searchModel, $pageSize, $stateMetadataAdapterClassName=null, $stickySearchKey=null, $setSticky=true)
 
 resolveToTriggerOnSearchEvents ($listModelClassName)
 
 getDataProviderByResolvingSelectAllFromGet ($searchModel, $pageSize, $userId, $stateMetadataAdapterClassName=null, $stickySearchKey=null)
 
 processMassEdit ($pageSize, $activeAttributes, $selectedRecordCount, $pageViewClassName, $listModel, $title, $dataProvider=null)
 
 processMassEditProgressSave ($modelClassName, $pageSize, $title, $dataProvider=null)
 
 makeMassEditProgressView ($model, $page, $selectedRecordCount, $start, $pageSize, $title, $skipCount)
 
 saveMassEdit ($modelClassName, $postVariableName, $selectedRecordCount, $dataProvider, $page, $pageSize)
 
 processMassDelete ($pageSize, $activeAttributes, $selectedRecordCount, $pageViewClassName, $listModel, $title, $dataProvider=null, $redirectUrl=null)
 
 processMassDeleteProgress ($modelClassName, $pageSize, $title, $dataProvider=null)
 
 makeMassDeleteProgressView ($model, $page, $selectedRecordCount, $start, $pageSize, $title, $skipCount)
 
 doMassDelete ($modelClassName, $postVariableName, $selectedRecordCount, $dataProvider, $page, $pageSize)
 
 resolveReturnUrlForMassAction ()
 
 attemptToSaveModelFromPost ($model, $redirectUrlParams=null, $redirect=true, $returnOnValidate=false)
 
 actionAfterSuccessfulModelSave ($model, $modelToStringValue, $redirectUrlParams=null)
 
 redirectAfterSaveModel ($modelId, $urlParams=null)
 
 triggerMassAction ($modelClassName, $searchForm, $pageView, $title, $searchView=null, $stateMetadataAdapterClassName=null, $useModuleClassNameForItemLabel=true)
 
 massActionProgress ($model, $pageSize, $title, $actionId, $dataProvider)
 
 massAction ($model, $pageSize, $title, $pageView, $actionId, $dataProvider, $useModuleClassNameForItemLabel=true)
 
 processMassAction ($pageSize, $selectedRecordCount, $pageViewClassName, $listModel, $title, $actionId, $dataProvider=null)
 
 makeMassActionView ($model, $activeAttributes, $selectedRecordCount, $title, $actionId, $useModuleClassNameForItemLabel=true)
 
 processMassActionProgress ($listModel, $pageSize, $title, $actionId, $dataProvider=null)
 
 makeMassActionProgressView ($model, $page, $selectedRecordCount, $start, $pageSize, $title, $skipCount, $actionId)
 
 resolveParamsForMassProgressView ()
 
 resolveActiveElementTypeForKanbanBoard (SearchForm $searchForm)
 
 resolveActiveElementTypeForKanbanBoardInDetailView ($detailsAndRelationsView)
 
 resolveKanbanBoardIsActiveByGetForDetailsView ($detailsAndRelationsView)
 
 beforeRedirect ($model)
 
 makeSearchAndListView ($searchModel, $moduleName, $dataProvider)
 
- Protected Member Functions inherited from Controller
 resolveKanbanBoardMetadataBeforeMakingDataProvider ($searchForm, &$metadata)
 
 resolveFilteredByMetadataBeforeMakingDataProvider ($searchForm, &$metadata)
 
 resolveMetadataBeforeMakingDataProvider (&$metadata)
 
 makeDetailsAndRelationsView ($model, $moduleClassName, $viewClassName, $redirectUrl, $breadCrumbView=null)
 
 resolveAdditionalParametersForDetailsAndRelationsView ($viewClassName)
 
 makeTitleBarAndEditAndDetailsView ($model, $renderType, $titleBarAndEditViewClassName= 'TitleBarAndEditAndDetailsView')
 
 makeEditAndDetailsView ($model, $renderType)
 
 makeTitleBarAndEditView ($model, $titleBarAndEditViewClassName)
 
 makeTitleBarAndDetailsView ($model, $titleBarAndDetailsViewClassName= 'TitleBarAndDetailsView')
 
 resolveActiveAttributesFromMassEditPost ()
 
 resolveActiveAttributesFromMassDeletePost ()
 
 makeMassEditView ($model, $activeAttributes, $selectedRecordCount, $title)
 
 makeMassDeleteView ($model, $activeAttributes, $selectedRecordCount, $title, $massDeleteViewClassName= 'MassDeleteView', $useModuleClassNameForItemLabel=true)
 
 getMassEditProgressStartFromGet ($getVariableName, $pageSize)
 
 getMassDeleteProgressStartFromGet ($getVariableName, $pageSize)
 
 attemptToValidateAjaxFromPost ($model, $postVariableName)
 
 getModelsToSave ($modelClassName, $dataProvider, $selectedRecordCount, $page, $pageSize)
 
 getModelsToDelete ($modelClassName, $dataProvider, $selectedRecordCount, $page, $pageSize)
 
 makeListMergeView ($model, $viewPrefix, $selectedList=array())
 

Static Protected Member Functions

static getSearchFormClassName ()
 
static getModelToApiDataUtil ()
 
static getModelToApiDataUtilData (RedBeanModel $model)
 
static resolveIncludingAdditionalData (Array &$data)
 
- Static Protected Member Functions inherited from ZurmoBaseController
static resolvePageValueForMassAction ($modelClassName)
 
static resolveViewIdByMassActionId ($actionId, $returnProgressViewName, $moduleName=null)
 
static applyGenericViewIdGenerationRules ($actionId)
 
static resolveTitleByMassActionId ($actionId)
 
static getZurmoControllerUtil ()
 
static getModelAndCatchNotFoundAndDisplayError ($modelClassName, $id)
 
static processModelsForMassAction ($model, $modelClassName, $selectedRecordCount, $dataProvider, $page, $pageSize, $insufficientPermissionSkipSavingUtil, $postModelClassName, $actionId)
 
static processModelsForMassActionWithoutScoring ($modelClassName, $selectedRecordCount, $dataProvider, $page, $pageSize, $insufficientPermissionSkipSavingUtil, $actionId)
 
static processModelsForMassEditAction ($postModelClassName, $model, $modelClassName, $selectedRecordCount, $dataProvider, $page, $pageSize, $insufficientPermissionSkipSavingUtil, $actionId)
 
static resolvePostDataByMassActionId ($actionId, $modelClassName=null)
 
static resolveSelectedRecordCountByMassActionId ($actionId, $dataProvider=null, $postData=array())
 
static resolveMassActionAlertMessage ($postVariableName, $actionId)
 
static resolvePageSizeByMassActionId ($actionId)
 
static toggleMuteScoringModelValueByMassActionId ($actionId, $mute=true)
 
static resolvePermissionOnSecurableItemByMassActionId ($actionId)
 
static processModelForMassDelete (&$model)
 
static resolveOffsetForDataProvider ($dataProvider, $actionId)
 
static processModelForMassEdit (&$model)
 
static resolveInsufficientPermissionSkipSavingUtilByMassActionId ($actionId)
 
static resolveProgressActionId ($actionId)
 
static resolveMassActionId ($actionId, $capitalizeFirst=true)
 
- Static Protected Member Functions inherited from Controller
static resolveDynamicSearchMetadata ($searchModel, $metadata, SearchAttributesDataCollection $dataCollection)
 
static resolveActiveAttributesFromPostForMassAction ($actionId)
 
static getSelectedRecordCountByResolvingSelectAllFromGet ($dataProvider, $countEmptyStringAsElement=true)
 
static getMassActionProgressStartFromGet ($pageVariableName, $pageSize)
 
static getModelsToUpdate ($modelClassName, $dataProvider, $selectedRecordCount, $page, $pageSize)
 
static getMassEditAlertMessage ($postVariableName)
 
static resolveMassEditAlertMessage ($postVariableName)
 

Additional Inherited Members

- Static Public Member Functions inherited from ZurmoBaseController
static getRightsFilterPath ()
 

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

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 ( )

Create new model, and send response

Exceptions
ApiException

Definition at line 118 of file ZurmoModuleApiController.php.

actionUpdate ( )

Update model and send response

Exceptions
ApiException

Definition at line 142 of file ZurmoModuleApiController.php.

actionDelete ( )

Delete model and send response

Exceptions
ApiException

Definition at line 171 of file ZurmoModuleApiController.php.

actionAddRelation ( )

Add related model to model's relations

Definition at line 186 of file ZurmoModuleApiController.php.

actionRemoveRelation ( )

Remove related model from model's relations

Definition at line 196 of file ZurmoModuleApiController.php.

getModelName ( )
protected

Get module primary model name

Definition at line 206 of file ZurmoModuleApiController.php.

processRead (   $id)
protected

Get model by id

Parameters
int$id
Exceptions
ApiException
Returns
ApiResult

Definition at line 217 of file ZurmoModuleApiController.php.

processList (   $params)
protected

List all models that satisfy provided criteria

Parameters
array$params
Exceptions
ApiException
Returns
ApiResult

Definition at line 267 of file ZurmoModuleApiController.php.

processListAttributes (   $params)
protected

List all model attributes

Parameters
$params
Returns
ApiResult
Exceptions
ApiException

Definition at line 377 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 405 of file ZurmoModuleApiController.php.

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

Definition at line 507 of file ZurmoModuleApiController.php.

processAddRelation (   $params)
protected

Add model relation

Parameters
array$params
Exceptions
ApiException
Returns
ApiResult

Definition at line 523 of file ZurmoModuleApiController.php.

processRemoveRelation (   $params)
protected

Remove model relation

Parameters
array$params
Exceptions
ApiException
Returns
ApiResult

Definition at line 575 of file ZurmoModuleApiController.php.

processCreate (   $data)
protected

Create new model

Parameters
$data
Returns
ApiResult
Exceptions
ApiException

Definition at line 626 of file ZurmoModuleApiController.php.

processUpdate (   $id,
  $data 
)
protected

Update model

Parameters
int$id
array$data
Exceptions
ApiException
Returns
ApiResult

Definition at line 683 of file ZurmoModuleApiController.php.

resolveModelScenario ( array &  $data)
protected

Resolve model scenario from data

Parameters
array$data
Returns
null

Definition at line 762 of file ZurmoModuleApiController.php.

setModelScenarioFromData ( RedBeanModel  $model,
array &  $data 
)
protected

Set model scenario

Parameters
RedBeanModel$model
array$data

Definition at line 778 of file ZurmoModuleApiController.php.

manageModelRelations (   $model,
  $modelRelations 
)
protected
Parameters
RedBeanModel$model
array$modelRelations
Returns
bool
Exceptions
ApiException

Definition at line 793 of file ZurmoModuleApiController.php.

processDelete (   $id)
protected

Delete model

Parameters
int$id
Exceptions
ApiException
Returns
ApiResult

Definition at line 855 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 897 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

Definition at line 923 of file ZurmoModuleApiController.php.

static getModelToApiDataUtil ( )
staticprotected

Util used to convert model to array

Returns
string

Definition at line 931 of file ZurmoModuleApiController.php.

static getModelToApiDataUtilData ( RedBeanModel  $model)
staticprotected

Returns data array for provided model using getModelToApiDataUtil

Parameters
RedBeanModel$model
Returns
array

Definition at line 941 of file ZurmoModuleApiController.php.

static resolveIncludingAdditionalData ( Array &  $data)
staticprotected

Override if you need to include additional data in API response

Parameters
array$data
Returns
array

Definition at line 955 of file ZurmoModuleApiController.php.

resolveStateMetadataAdapterClassName ( )
protected

Resolve StateMetadataAdapterClassName

Returns
mixed

Definition at line 963 of file ZurmoModuleApiController.php.

processGetDeletedItems (   $params)
protected

Get array of deleted items since beginning or since datetime in past

Parameters
array$params
Returns
ApiResult
Exceptions
ApiException

Definition at line 985 of file ZurmoModuleApiController.php.

processGetCreatedItems (   $params)
protected

Get array of newly created items since beginning or since datetime in past

Parameters
$params
Returns
ApiResult
Exceptions
ApiException

Definition at line 1063 of file ZurmoModuleApiController.php.

processGetModifiedItems (   $params)

Get array of modified items since beginning or since datetime in past

Parameters
$params
Returns
ApiResult
Exceptions
ApiException

Definition at line 1140 of file ZurmoModuleApiController.php.


The documentation for this class was generated from the following file:
Generated on Thu Feb 20 2020 07:10:57