+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
/**
- * File for the CiviCRM APIv3 address functions
+ * This api exposes CiviCRM Address records.
*
* @package CiviCRM_APIv3
- * @subpackage API_Address
- *
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: Address.php 2011-02-16 ErikHommel $
*/
/**
- * Add an Address for a contact
- *
- * Allowed @params array keys are:
- * {@getfields address_create}
- * {@example AddressCreate.php}
+ * Add an Address for a contact.
*
* @param array $params
+ * Array per getfields metadata.
*
* @return array
- * Array of newly created tag property values.
*/
function civicrm_api3_address_create(&$params) {
/**
}
else {
$values = _civicrm_api3_dao_to_array($addressBAO, $params);
- return civicrm_api3_create_success($values, $params, 'address', $addressBAO);
+ return civicrm_api3_create_success($values, $params, 'Address', $addressBAO);
}
}
/**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action.
*
* @param array $params
- * Array or parameters determined by getfields.
+ * Array of parameters determined by getfields.
*/
function _civicrm_api3_address_create_spec(&$params) {
$params['location_type_id']['api.required'] = 1;
$params['contact_id']['api.required'] = 1;
- $params['country'] = array('title' => 'Name or 2-letter abbreviation of country. Looked up in civicrm_country table');
- $params['street_parsing'] = array('title' => 'optional param to indicate you want the street_address field parsed into individual params');
+ $params['street_parsing'] = array(
+ 'title' => 'Street Address Parsing',
+ 'description' => 'Optional param to indicate you want the street_address field parsed into individual params',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ );
$params['world_region'] = array(
'title' => ts('World Region'),
'name' => 'world_region',
);
}
/**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
*
* @param array $params
- * Array or parameters determined by getfields.
+ * Array of parameters determined by getfields.
*/
function _civicrm_api3_address_get_spec(&$params) {
$params['world_region'] = array(
}
/**
- * Deletes an existing Address
+ * Delete an existing Address.
*
* @param array $params
- *
- * {@getfields address_delete}
- * {@example AddressDelete.php 0}
+ * Array per getfields metadata.
*
* @return array
* api result array
}
/**
- * Retrieve one or more addresses on address_id, contact_id, street_name, city
- * or a combination of those
- *
- * @param mixed[] (reference ) input parameters
+ * Retrieve one or more addresses.
*
- * {@example AddressGet.php 0}
* @param array $params
- * An associative array of name/value pairs.
+ * Array per getfields metadata.
*
* @return array
* details of found addresses else error
- * {@getfields address_get}
*/
function civicrm_api3_address_get(&$params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Address');