Case.php
This api exposes CiviCRM Case objects.
Developed by woolman.org
Table of Contents
Functions
- civicrm_api3_case_create() : array<string|int, mixed>
- Open a new case, add client and manager roles, and standard timeline.
- _civicrm_api3_case_create_xmlProcessor() : mixed
- When creating a new case, run the xmlProcessor to get all necessary params/configuration for the new case, as cases use an xml file to store their configuration.
- _civicrm_api3_case_get_spec() : mixed
- Adjust Metadata for Get Action.
- _civicrm_api3_case_create_spec() : mixed
- Adjust Metadata for Create Action.
- _civicrm_api3_case_update_spec() : mixed
- Adjust Metadata for Update action.
- _civicrm_api3_case_delete_spec() : mixed
- Adjust Metadata for Delete action.
- civicrm_api3_case_get() : array<string|int, mixed>
- Get details of a particular case, or search for cases, depending on params.
- civicrm_api3_case_activity_create() : array<string|int, mixed>
- Deprecated API.
- civicrm_api3_case_addtimeline() : array<string|int, mixed>
- Add a timeline to a case.
- _civicrm_api3_case_addtimeline_spec() : mixed
- Adjust Metadata for addtimeline action.
- civicrm_api3_case_merge() : array<string|int, mixed>
- Merge 2 cases.
- _civicrm_api3_case_merge_spec() : mixed
- Adjust Metadata for merge action.
- _civicrm_api3_case_deprecation() : array<string|int, mixed>
- Declare deprecated api functions.
- civicrm_api3_case_update() : array<string|int, mixed>
- civicrm_api3_case_delete() : mixed
- Delete a specified case.
- _civicrm_api3_case_restore_spec() : void
- Case.restore API specification
- civicrm_api3_case_restore() : mixed
- Restore a specified case from the trash.
- _civicrm_api3_case_read() : mixed
- Augment case results with extra data.
- _civicrm_api3_case_format_params() : mixed
- Internal function to format create params for processing.
- civicrm_api3_case_getList() : mixed
- It actually works a lot better to use the CaseContact api instead of the Case api for entityRef fields so we can perform the necessary joins, so we pass off getlist requests to the CaseContact api.
- _civicrm_api3_case_getlist_spec() : mixed
- Needed due to the above override
- civicrm_api3_case_getoptions() : mixed
Functions
civicrm_api3_case_create()
Open a new case, add client and manager roles, and standard timeline.
civicrm_api3_case_create(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
// REQUIRED for create: 'case_type_id' => int OR 'case_type' => str (provide one or the other) 'contact_id' => int // case client 'subject' => str // REQUIRED for update: 'id' => case Id //OPTIONAL 'medium_id' => int // see civicrm option values for possibilities 'creator_id' => int // case manager, default to the logged in user 'status_id' => int // defaults to 1 "ongoing" 'location' => str 'start_date' => str datestamp // defaults to: date('YmdHis') 'duration' => int // in minutes 'details' => str // html format
Tags
Return values
array<string|int, mixed> —api result array
_civicrm_api3_case_create_xmlProcessor()
When creating a new case, run the xmlProcessor to get all necessary params/configuration for the new case, as cases use an xml file to store their configuration.
_civicrm_api3_case_create_xmlProcessor(array<string|int, mixed> $params, CRM_Case_DAO_Case $caseBAO) : mixed
Parameters
- $params : array<string|int, mixed>
- $caseBAO : CRM_Case_DAO_Case
Tags
_civicrm_api3_case_get_spec()
Adjust Metadata for Get Action.
_civicrm_api3_case_get_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Parameters determined by getfields.
_civicrm_api3_case_create_spec()
Adjust Metadata for Create Action.
_civicrm_api3_case_create_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Array of parameters determined by getfields.
_civicrm_api3_case_update_spec()
Adjust Metadata for Update action.
_civicrm_api3_case_update_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Array of parameters determined by getfields.
_civicrm_api3_case_delete_spec()
Adjust Metadata for Delete action.
_civicrm_api3_case_delete_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Array of parameters determined by getfields.
civicrm_api3_case_get()
Get details of a particular case, or search for cases, depending on params.
civicrm_api3_case_get(array<string|int, mixed> $params[, mixed $sql = NULL ]) : array<string|int, mixed>
Please provide one (and only one) of the four get/search parameters:
Parameters
- $params : array<string|int, mixed>
-
'id' => if set, will get all available info about a case, including contacts and activities
// if no case_id provided, this function will use one of the following search parameters: 'client_id' => finds all cases with a specific client 'activity_id' => returns the case containing a specific activity 'contact_id' => finds all cases associated with a contact (in any role, not just client) $params CRM_Utils_SQL_Select $sql Other apis wishing to wrap & extend this one can pass in a $sql object with extra clauses
- $sql : mixed = NULL
Tags
Return values
array<string|int, mixed> —(get mode, case_id provided): Array with case details, case roles, case activity ids, (search mode, case_id not provided): Array of cases found
civicrm_api3_case_activity_create()
Deprecated API.
civicrm_api3_case_activity_create(array<string|int, mixed> $params) : array<string|int, mixed>
Use activity API instead.
Parameters
- $params : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>civicrm_api3_case_addtimeline()
Add a timeline to a case.
civicrm_api3_case_addtimeline(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>_civicrm_api3_case_addtimeline_spec()
Adjust Metadata for addtimeline action.
_civicrm_api3_case_addtimeline_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Array of parameters determined by getfields.
civicrm_api3_case_merge()
Merge 2 cases.
civicrm_api3_case_merge(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>_civicrm_api3_case_merge_spec()
Adjust Metadata for merge action.
_civicrm_api3_case_merge_spec(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
-
Array of parameters determined by getfields.
_civicrm_api3_case_deprecation()
Declare deprecated api functions.
api notice
_civicrm_api3_case_deprecation() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of deprecated actions
civicrm_api3_case_update()
Update a specified case. Use civicrm_api3_case_create() instead.
civicrm_api3_case_update(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
- $params : array<string|int, mixed>
-
//REQUIRED: 'case_id' => int
//OPTIONAL 'status_id' => int 'start_date' => str datestamp 'contact_id' => int // case client
Tags
Return values
array<string|int, mixed> —api result array
civicrm_api3_case_delete()
Delete a specified case.
civicrm_api3_case_delete(array<string|int, mixed> $params) : mixed
Parameters
- $params : array<string|int, mixed>
-
//REQUIRED: 'id' => int //OPTIONAL 'move_to_trash' => bool (defaults to false)
Tags
_civicrm_api3_case_restore_spec()
Case.restore API specification
_civicrm_api3_case_restore_spec(array<string|int, mixed> &$spec) : void
Parameters
- $spec : array<string|int, mixed>
-
description of fields supported by this API call
civicrm_api3_case_restore()
Restore a specified case from the trash.
civicrm_api3_case_restore(array<string|int, mixed> $params) : mixed
Parameters
- $params : array<string|int, mixed>
Tags
_civicrm_api3_case_read()
Augment case results with extra data.
_civicrm_api3_case_read(array<string|int, mixed> &$cases, array<string|int, mixed> $options) : mixed
Parameters
- $cases : array<string|int, mixed>
- $options : array<string|int, mixed>
_civicrm_api3_case_format_params()
Internal function to format create params for processing.
_civicrm_api3_case_format_params(array<string|int, mixed> &$params) : mixed
Parameters
- $params : array<string|int, mixed>
civicrm_api3_case_getList()
It actually works a lot better to use the CaseContact api instead of the Case api for entityRef fields so we can perform the necessary joins, so we pass off getlist requests to the CaseContact api.
civicrm_api3_case_getList(array<string|int, mixed> $params) : mixed
Parameters
- $params : array<string|int, mixed>
_civicrm_api3_case_getlist_spec()
Needed due to the above override
_civicrm_api3_case_getlist_spec(array<string|int, mixed> &$params, array<string|int, mixed> $apiRequest) : mixed
Parameters
- $params : array<string|int, mixed>
- $apiRequest : array<string|int, mixed>
civicrm_api3_case_getoptions()
civicrm_api3_case_getoptions(mixed $params) : mixed
Parameters
- $params : mixed