X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FCustomValue.php;h=7f905a0c8c40d85964bf425523dc36402e74cd11;hb=709e574bfc8b047d9e9f9a6ad84595bc3f560b54;hp=667bd0f26b97917a0028bdd5adee1ab13ef4690b;hpb=a6c01b45f0cdaee8677de72b8bf3e784d8b6b62a;p=civicrm-core.git diff --git a/api/v3/CustomValue.php b/api/v3/CustomValue.php index 667bd0f26b..7f905a0c8c 100644 --- a/api/v3/CustomValue.php +++ b/api/v3/CustomValue.php @@ -1,5 +1,4 @@ 123, - * // (omitting :id) inserts or updates a field in a single-valued group - * 'custom_6' => 'foo', - * // custom_24 is checkbox or multiselect, so pass items as an array - * 'custom_24' => array('bar', 'baz'), - * // in this case custom_33 is part of a multi-valued group, and we're updating record id 5 - * 'custom_33:5' => value, - * // inserts new record in multi-valued group - * 'custom_33:-1' => value, - * // inserts another new record in multi-valued group - * 'custom_33:-2' => value, - * // you can use group_name:field_name instead of ID - * 'custom_some_group:my_field => 'myinfo', - * // updates record ID 8 in my_other_field in multi-valued some_big_group - * 'custom_some_big_group:my_other_field:8 => 'myinfo', + * + * @example + * // entity ID. You do not need to specify entity type, we figure it out based on the fields you're using + * 'entity_id' => 123, + * // (omitting :id) inserts or updates a field in a single-valued group + * 'custom_6' => 'foo', + * // custom_24 is checkbox or multiselect, so pass items as an array + * 'custom_24' => array('bar', 'baz'), + * // in this case custom_33 is part of a multi-valued group, and we're updating record id 5 + * 'custom_33:5' => value, + * // inserts new record in multi-valued group + * 'custom_33:-1' => value, + * // inserts another new record in multi-valued group + * 'custom_33:-2' => value, + * // you can use group_name:field_name instead of ID + * 'custom_some_group:my_field => 'myinfo', + * // updates record ID 8 in my_other_field in multi-valued some_big_group + * 'custom_some_big_group:my_other_field:8 => 'myinfo', * * * @throws Exception - * @return array('values' => TRUE) or array('is_error' => 1, 'error_message' => 'what went wrong') + * @return array + * ['values' => TRUE] or ['is_error' => 1, 'error_message' => 'what went wrong'] * - * @access public */ function civicrm_api3_custom_value_create($params) { // @todo it's not clear where the entity_table is used as CRM_Core_BAO_CustomValueTable::setValues($create) @@ -129,20 +124,19 @@ function _civicrm_api3_custom_value_create_spec(&$params) { /** * Use this API to get existing custom values for an entity. * - * @param $params + * @param array $params * Array specifying the entity_id. - * Optionally include entity_type param, i.e. 'entity_type' => 'Activity' - * If no entity_type is supplied, it will be determined based on the fields you request. - * If no entity_type is supplied and no fields are specified, 'Contact' will be assumed. - * Optionally include the desired custom data to be fetched (or else all custom data for this entity will be returned) - * Example: 'entity_id' => 123, 'return.custom_6' => 1, 'return.custom_33' => 1 - * If you do not know the ID, you may use group name : field name, for example 'return.foo_stuff:my_field' => 1 + * Optionally include entity_type param, i.e. 'entity_type' => 'Activity' + * If no entity_type is supplied, it will be determined based on the fields you request. + * If no entity_type is supplied and no fields are specified, 'Contact' will be assumed. + * Optionally include the desired custom data to be fetched (or else all custom data for this entity will be returned) + * Example: 'entity_id' => 123, 'return.custom_6' => 1, 'return.custom_33' => 1 + * If you do not know the ID, you may use group name : field name, for example 'return.foo_stuff:my_field' => 1 * * @throws API_Exception * @return array - * * - * @access public + * */ function civicrm_api3_custom_value_get($params) {