Version 9 (modified by 11 years ago) ( diff ) | ,
---|
CiviCRM API - Adding Custom Values to Case Get
Getting entities filtered by the value of custom field is only available for Contacts. Below is a deconstruction of the get API function for Contacts. Hopefully it'll show where the custom field magic happens.
Each method gets a section (with the file it is in parenthesis) which contains a list of the functions that it calls. Hopefully I'll add some explanations of the processes that occurs in each later on.
civicrm_api3_contact_get (api/v2/Contact.php)
The API function.
- _civicrm_api3_contact_get_supportanomalies (api/v3/Contact.php)
- _civicrm_api3_get_using_query_object (api\v3\utils.php)
- civicrm_api3_create_success (api\v3\utils.php)
_civicrm_api3_contact_get_supportanomalies (api/v2/Contact.php)
Changes a few of the parameters around for consistency and convenience.
No functions called
_civicrm_api3_get_using_query_object (api\v3\utils.php)
The comment for this function says that it is a general function for more complex get requests that is only used currently for Contacts, but can, and should, be extended for use by other entities. However, there is explicit use of the Contact BAO object in the method, so that aint gonna work is it?
- _civicrm_api3_get_options_from_params (api\v3\utils.php)
- civicrm_api($entity, 'getfields', array('version' => 3, 'action' => 'get'));
- CRM_Contact_BAO_Query::convertFormValues (CRM/Contact/BAO/Query.php)
- CRM_Core_DAO::createSqlFilter (CRM\Core\DAO.php)
- CRM_Contact_BAO_Query::apiQuery (CRM/Contact/BAO/Query.php)
civicrm_api3_create_success (api\v3\utils.php)
This wraps the the values created from the specific API request with things like count and is_error, etc. It also does some legacy shenanigans. Calls nothing else of importance.
_civicrm_api3_get_options_from_params (api\v3\utils.php)
This function extracts the common API options from the parameters. It also extracts and standardises the 'return' properties. It calls nothing else of importance.
CRM_Contact_BAO_Query::convertFormValues (CRM/Contact/BAO/Query.php)
Converts some of parameters from one format (presumably that used to display them on a form) to another (presumably one used by the database).
- CRM_Contact_BAO_Query::fixDateValues (CRM/Contact/BAO/Query.php)
- CRM_Contact_BAO_Query::fixWhereValues (CRM/Contact/BAO/Query.php)
CRM_Contact_BAO_Query::fixDateValues (CRM/Contact/BAO/Query.php)
Not Checked
CRM_Contact_BAO_Query::fixWhereValues (CRM/Contact/BAO/Query.php)
Not Checked
CRM_Core_DAO::createSqlFilter (CRM\Core\DAO.php)
Not Checked