X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FAddress.php;h=7c95d30d38acefc8c3b967768184a006e8cea24b;hb=c7a0ed3d5062c17608e6d8e5ccafa5b0e5982c42;hp=f1f9185682ce01ed66fcc02bb2c6d78e12b08e4a;hpb=1a4d747351c5963b20ad798f3bd0480eb772b13b;p=civicrm-core.git diff --git a/api/v3/Address.php b/api/v3/Address.php index f1f9185682..7c95d30d38 100644 --- a/api/v3/Address.php +++ b/api/v3/Address.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -23,29 +23,21 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** - * 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) { /** @@ -85,23 +77,25 @@ function civicrm_api3_address_create(&$params) { return civicrm_api3_create_error("Address is not created or updated "); } else { - $values = array(); $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', @@ -109,10 +103,10 @@ function _civicrm_api3_address_create_spec(&$params) { ); } /** - * 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( @@ -123,12 +117,10 @@ function _civicrm_api3_address_get_spec(&$params) { } /** - * 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 @@ -138,18 +130,13 @@ function civicrm_api3_address_delete($params) { } /** - * 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');