X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FRelationshipType.php;h=7e2eb908e89d4b7c2963d99d5a85812270e3847e;hb=d1b0d05ec1b6bd4ecbeb474641387e44fd0ba504;hp=12501eea7f0bf2c50adc48da200cfe8626949946;hpb=24a70b661b4cdd5798445955249a1de00ec9e835;p=civicrm-core.git diff --git a/api/v3/RelationshipType.php b/api/v3/RelationshipType.php index 12501eea7f..7e2eb908e8 100644 --- a/api/v3/RelationshipType.php +++ b/api/v3/RelationshipType.php @@ -33,19 +33,15 @@ * @subpackage API_Contact * @copyright CiviCRM LLC (c) 2004-2014 * $Id: Contact.php 30415 2010-10-29 12:02:47Z shot $ - * */ /** - * create relationship type + * Create relationship type. * * @param array $params - * Associative array of property name/value pairs to insert in new relationship type. + * Array per getfields metadata. * * @return array - * {@getfields RelationshipType_create} - * @access public - * {@schema Contact/RelationshipType.xml} */ function civicrm_api3_relationship_type_create($params) { @@ -67,7 +63,6 @@ function civicrm_api3_relationship_type_create($params) { $ids['relationshipType'] = CRM_Utils_Array::value('id', $params); } - $relationType = new CRM_Contact_BAO_RelationshipType(); $relationType = CRM_Contact_BAO_RelationshipType::add($params, $ids); $relType = array(); @@ -78,9 +73,10 @@ function civicrm_api3_relationship_type_create($params) { } /** - * Adjust Metadata for Create action + * Adjust Metadata for Create action. + * + * The metadata is used for setting defaults, documentation & validation. * - * The metadata is used for setting defaults, documentation & validation * @param array $params * Array or parameters determined by getfields. */ @@ -93,12 +89,10 @@ function _civicrm_api3_relationship_type_create_spec(&$params) { } /** - * get all relationship type - * retruns An array of Relationship_type - * @access public - * {@getfields RelationshipType_get} - * @example RelationshipTypeGet.php + * Get all relationship types. + * * @param array $params + * * @return array */ function civicrm_api3_relationship_type_get($params) { @@ -106,14 +100,28 @@ function civicrm_api3_relationship_type_get($params) { } /** - * Delete a relationship type delete + * Delete a relationship type. * - * @param id of relationship type $id + * @param array $params * * @return array * API Result Array - * {@getfields RelationshipType_delete} */ function civicrm_api3_relationship_type_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); } + +/** + * Get list defaults for relationship types. + * + * @see _civicrm_api3_generic_getlist_defaults + * + * @param array $request + * @return array + */ +function _civicrm_api3_relationship_type_getlist_defaults($request) { + return array( + 'label_field' => 'label_a_b', + 'search_field' => 'label_a_b', + ); +}