3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM user framework join.
15 * @package CiviCRM_APIv3
19 * Takes an associative array and creates a uf join in the database.
21 * @param array $params
22 * Array per getfields metadata.
25 * CRM_Core_DAO_UFJoin Array
27 function civicrm_api3_uf_join_create($params) {
29 $ufJoin = CRM_Core_BAO_UFJoin
::create($params);
30 _civicrm_api3_object_to_array($ufJoin, $ufJoinArray[]);
31 return civicrm_api3_create_success($ufJoinArray, $params, 'UFJoin', 'create');
35 * Adjust Metadata for Create action.
37 * @param array $params
38 * Array of parameters determined by getfields.
40 * @todo - suspect module, weight don't need to be required - need to test
42 function _civicrm_api3_uf_join_create_spec(&$params) {
43 $params['module']['api.required'] = 1;
44 $params['weight']['api.required'] = 1;
45 $params['uf_group_id']['api.required'] = 1;
49 * Get CiviCRM UF_Joins (ie joins between CMS user records & CiviCRM user record.
51 * @param array $params
52 * Array of name/value pairs.
57 function civicrm_api3_uf_join_get($params) {
58 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
62 * Delete a CiviCRM UF_Join.
64 * @param array $params
65 * Array of name/value pairs.
70 function civicrm_api3_uf_join_delete($params) {
71 return _civicrm_api3_basic_delete('CRM_Core_BAO_UFJoin', $params);