}
/**
- * Initialize
+ * Initialize.
*/
public function init() {
CRM_Core_DAO::init($this->cfg->dsn);
}
/**
+ * Get attribute.
+ *
* @param $name
* @param null $value
+ *
* @return $this
*/
public function attr($name, $value = NULL) {
}
/**
+ * Check if var is set.
+ *
* @param string $name
* @return bool
*/
}
/**
- * @param $name
+ * Get object.
+ *
+ * @param string $name
* @return $this
*/
public function __get($name) {
*/
/**
- * Add a record relating a contact with an activity
- *
- * Allowed @params array keys are:
- *
- * @example ActivityContact.php
+ * Add a record relating a contact with an activity.
*
* @param array $params
*
* @return array
- * Array of newly created activity contact records.
+ * API result array.
*/
function civicrm_api3_activity_contact_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * This function is used to format the soft credit for backward compatibility
- * as of v4.4 we support multiple soft credit, so now contribution returns array with 'soft_credit' as key
+ * This function is used to format the soft credit for backward compatibility.
+ *
+ * As of v4.4 we support multiple soft credit, so now contribution returns array with 'soft_credit' as key
* but we still return first soft credit as a part of contribution array
* @param $contribution
*/
}
/**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action.
*
* The metadata is used for setting defaults, documentation & validation.
*
}
/**
- * take the input parameter list as specified in the data model and
- * convert it into the same format that we use in QF and BAO object
+ * Legacy handling for contribution parameters.
+ *
+ * Take the input parameter list as specified in the data model and
+ * convert it into the same format that we use in QF and BAO object.
*
* @param array $params
* property name/value pairs to insert in new contact.
}
/**
- * Adjust Metadata for Transact action
+ * Adjust Metadata for Transact action.
*
* The metadata is used for setting defaults, documentation & validation.
*
* Process a transaction and record it against the contact.
*
* @param array $params
- * (reference ) input parameters.
+ * Input parameters.
*
* @return array
* contribution of created or updated record (or a civicrm error)
}
/**
- * Send a contribution confirmation (receipt or invoice)
+ * Send a contribution confirmation (receipt or invoice).
+ *
* The appropriate online template will be used (the existence of related objects
* (e.g. memberships ) will affect this selection
*
* Input parameters.
*
* @throws Exception
- * Api result array.
*/
function civicrm_api3_contribution_sendconfirmation($params) {
$contribution = new CRM_Contribute_BAO_Contribution();
}
/**
- * Adjust Metadata for sendconfirmation action
+ * Adjust Metadata for sendconfirmation action.
*
* The metadata is used for setting defaults, documentation & validation.
*
}
/**
- * Complete an existing (pending) transaction, updating related entities (participant, membership, pledge etc)
- * and taking any complete actions from the contribution page (e.g. send receipt)
+ * Complete an existing (pending) transaction.
+ *
+ * This will update related entities (participant, membership, pledge etc)
+ * and take any complete actions from the contribution page (e.g. send receipt).
*
* @todo - most of this should live in the BAO layer but as we want it to be an addition
* to 4.3 which is already stable we should add it to the api layer & re-factor into the BAO layer later
*
* @param array $params
* Input parameters.
- * {@getfields Contribution_completetransaction}
*
* @throws API_Exception
* Api result array.
*
* @throws API_Exception
* @return array
- *
- *
*/
function civicrm_api3_custom_value_get($params) {
*/
/**
- * Create or update a loc_block
+ * Create or update a loc_block.
*
* @param array $params
* Associative array of property.
* name/value pairs to insert in new 'loc_block'
- * @example LocBlockCreate.php Std Create example
*
* @return array
- * api result array
- * {@getfields loc_block_create}
+ * API result array.
*/
function civicrm_api3_loc_block_create($params) {
$entities = array();
}
/**
- * Returns array of loc_blocks matching a set of one or more properties
+ * Returns array of loc_blocks matching a set of one or more properties.
*
* @param array $params
* Array of one or more valid property_name=>value pairs. If $params is set.
* as null, all loc_blocks will be returned (default limit is 25)
*
* @return array
- * Array of matching loc_blocks
- * {@getfields loc_block_get}
+ * API result array.
*/
function civicrm_api3_loc_block_get($params) {
$options = _civicrm_api3_get_options_from_params($params);
}
/**
- * delete an existing loc_block
- *
- * This method is used to delete any existing loc_block.
- * id of the record to be deleted is required field in $params array
+ * Delete an existing loc_block.
*
* @param array $params
* Array containing id of the record to be deleted.
*
* @return array
- * API result array
- * {@getfields loc_block_delete}
+ * API result array.
*/
function civicrm_api3_loc_block_delete($params) {
return _civicrm_api3_basic_delete('CRM_Core_DAO_LocBlock', $params);
*/
/**
- * Add a Location Type
- *
- * Allowed @params array keys are:
- *
- * @example LocationTypeCreate.php Standard Create Example
+ * Add a Location Type.
*
* @param array $params
*
* @return array
- * API result array
- * {@getfields email_create}
+ * API result array.
*/
function civicrm_api3_location_type_create($params) {
//set display_name equal to name if it's not defined
}
/**
- * Deletes an existing Location Type
+ * Deletes an existing Location Type.
*
* @param array $params
*
- * @example LocationTypeDelete.php Standard Delete Example
- *
* @return array
- * API result array
- * {@getfields LocationType_delete}
+ * API result array.
*/
function civicrm_api3_location_type_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Retrieve one or more Location Types
- *
- * @example LocationTypeGet.php Standard Get Example
+ * Retrieve one or more Location Types.
*
* @param array $params
* An associative array of name/value pairs.
*
* @return array
- * api result
- * {@getfields LocationType_get}
+ * API result array.
*/
function civicrm_api3_location_type_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*/
/**
- * Create or update a mail_settings
+ * Create or update a mail_settings.
*
* @param array $params
- * Associative array of property.
+ * Array of property.
* name/value pairs to insert in new 'mail_settings'
- * @example mail_settingsCreate.php Std Create example
*
* @return array
- * api result array
- * {@getfields mail_settings_create}
+ * API result array.
*/
function civicrm_api3_mail_settings_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Returns array of mail_settings matching a set of one or more group properties
+ * Returns array of mail_settings matching a set of one or more group properties.
*
* @param array $params
* Array of one or more valid.
* as null, all mail_settings will be returned
*
* @return array
- * Array of matching mail_settings
- * {@getfields mail_settings_get}
+ * API result array.
*/
function civicrm_api3_mail_settings_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * delete an existing mail_settings
- *
- * This method is used to delete any existing mail_settings. id of the group
- * to be deleted is required field in $params array
+ * Delete an existing mail_settings.
*
* @param array $params
* Array containing id of the group.
* to be deleted
*
* @return array
- * api result array
- * {@getfields mail_settings_delete}
+ * API result array.
*/
function civicrm_api3_mail_settings_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*
* @param array $params
*
- * @return array API Success Array
+ * @return array
* API Success Array
* @throws \API_Exception
* @throws \Civi\API\Exception\UnauthorizedException
*/
/**
- * Handle a create mailing ab testing
+ * Handle a create mailing ab testing.
*
* @param array $params
*
}
/**
- * Adjust Metadata for submit action
+ * Adjust Metadata for submit action.
*
* The metadata is used for setting defaults, documentation & validation.
*
}
/**
- * Send A/B mail to A/B recipients respectively
+ * Send A/B mail to A/B recipients respectively.
*
* @param array $params
+ *
* @return array
* @throws API_Exception
*/
}
/**
- * Adjust Metadata for graph_stats action
+ * Adjust Metadata for graph_stats action.
*
* The metadata is used for setting defaults, documentation & validation.
*
}
/**
- * Send graph detail for A/B tests mail
+ * Send graph detail for A/B tests mail.
*
* @param array $params
+ *
* @return array
* @throws API_Exception
*/
*
* @throws API_Exception
* @return array
- * Array of newly created mailing_component property values.
+ * API result array.
*/
function civicrm_api3_mailing_component_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Get a mailing_component
- *
- * Allowed @params array keys are:
- * {@getfields mailing_component_get}
- * @example mailing_componentCreate.php
+ * Get a mailing_component.
*
* @param array $params
*
* @return array
- * Array of retrieved mailing_component property values.
+ * API result array.
*/
function civicrm_api3_mailing_component_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Delete a mailing_component
- *
- * Allowed @params array keys are:
- * {@getfields mailing_component_delete}
- * @example mailing_componentCreate.php
+ * Delete a mailing_component.
*
* @param array $params
*
* @throws API_Exception
* @return array
- * Array of deleted values.
+ * API result array.
*/
function civicrm_api3_mailing_component_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
+ * Get bounced mailing contact records.
+ *
* @param int $contactID
* @param $offset
* @param $limit
*/
/**
- * Deletes an existing contact membership
- *
- * This API is used for deleting a contact membership
+ * Deletes an existing contact membership.
*
* @param array $params
* Array array holding id - Id of the contact membership to be deleted.
*
* @return array
- * api result
- * {@getfields membership_delete}
+ * API result array.
*/
function civicrm_api3_membership_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* Required parameters : membership_type_id and status_id.
*
* @param array $params
- * An associative array of name/value property values of civicrm_membership.
+ * Array of name/value property values of civicrm_membership.
*
* @return array
- * Array of newly created membership property values.
- * {@getfields membership_create}
+ * API result array.
*/
function civicrm_api3_membership_create($params) {
// check params for membership id during update
/**
- * non-standard behaviour inherited from v2
+ * Non-standard behaviour inherited from v2.
*
* @param array $params
* Parameters passed into get function.
*/
/**
- * Add or update a link between contribution and membership
+ * Add or update a link between contribution and membership.
*
* @param array $params
- * (reference ) input parameters.
+ * Input parameters.
*
* @return array
- * (reference ) membership_payment_id of created or updated record
- * {@getfields MembershipPayment_create}
- * @example MembershipPaymentCreate.php
+ * API result array.
*/
function civicrm_api3_membership_payment_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Retrieve one / all contribution(s) / membership(s) linked to a
- * membership / contrbution.
+ * Retrieve one or more membership payment records.
*
* @param array $params
* Input parameters.
*
* @return array
- * array of properties, if error an array with an error id and error message
- * @example MembershipPaymentGet
- * {@getfields MembershipPayment_get}
+ * API result array.
*/
function civicrm_api3_membership_payment_get($params) {
return _civicrm_api3_basic_get('CRM_Member_DAO_MembershipPayment', $params);
*
* @copyright CiviCRM LLC (c) 2004-2014
* @version $Id: MembershipType.php 30171 2010-10-14 09:11:27Z mover $
- *
*/
/**
- * API to Create or update a Membership Type
+ * API to Create or update a Membership Type.
*
* @param array $params
- * An associative array of name/value property values of civicrm_membership_type.
+ * Array of name/value property values of civicrm_membership_type.
*
* @return array
- * newly created or updated membership type property values.
+ * API result array.
*/
function civicrm_api3_membership_type_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Membership_type');
* This api is used for finding an existing membership type.
*
* @param array $params
- * An associative array of name/value property values of civicrm_membership_type.
- * {getfields MembershipType_get}
+ * Array of name/value property values of civicrm_membership_type.
*
* @return array
- * Array of all found membership type property values.
+ * API result array.
*/
function civicrm_api3_membership_type_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Deletes an existing membership type
- *
- * This API is used for deleting a membership type
- * Required parameters : id of a membership type
+ * Deletes an existing membership type.
*
* @param array $params
*
- * @return bool
- * true if success, else false
+ * @return array
+ * API result array.
*/
function civicrm_api3_membership_type_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
+ * Adjust metadata for message_template get action.
+ *
* @param array $params
*/
function _civicrm_api3_message_template_get_spec(&$params) {
}
/**
- * Retrieve one or more message_template
+ * Retrieve one or more message_template.
*
* @param array $params
- * An associative array of name/value pairs.
+ * Array of name/value pairs.
*
* @return array
- * api result array
+ * API result array.
*/
function civicrm_api3_message_template_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
/**
* Sends a template.
+ *
* @param array $params
*/
function civicrm_api3_message_template_send($params) {
*/
/**
- * Create or update a price_field_value
+ * Create or update a price_field_value.
*
* @param array $params
- * Associative array of property.
+ * Array of property.
* name/value pairs to insert in new 'price_field_value'
- * @example PriceFieldValueCreate.php Std Create example
*
* @return array
- * api result array
- * {@getfields price_field_value_create}
+ * API result array.
*/
function civicrm_api3_price_field_value_create($params) {
$ids = array();
}
/**
- * Returns array of price_field_values matching a set of one or more group properties
+ * Returns array of price_field_values matching a set of one or more group properties.
*
* @param array $params
* Array of one or more valid property_name=>value pairs. If $params is set.
* as null, all price_field_values will be returned (default limit is 25)
*
* @return array
- * Array of matching price_field_values
- * {@getfields price_field_value_get}
+ * API result array.
*/
function civicrm_api3_price_field_value_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * delete an existing price_field_value
+ * Delete an existing price_field_value.
*
* This method is used to delete any existing price_field_value. id of the group
* to be deleted is required field in $params array
* to be deleted
*
* @return array
- * API result array
- * {@getfields price_field_value_delete}
+ * API result array.
*/
function civicrm_api3_price_field_value_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
/**
* Submit a set of fields against a profile.
+ *
* Note choice of submit versus create is discussed CRM-13234 & related to the fact
* 'profile' is being treated as a data-entry entity
*
}
/**
+ * Translate field names for BAO.
+ *
* The api standards expect field names to be lower case but the BAO uses mixed case
* so we accept 'email-primary' but pass 'email-Primary' to the BAO
* we could make the BAO handle email-primary but this would alter the fieldname seen by hooks
* & we would need to consider that change
+ *
* @param string $fieldName
* API field name.
*
}
/**
- * Alter metadata for getfields functions
+ * Alter metadata for getfields functions.
+ *
* @param array $params
*/
function _civicrm_api3_setting_getfields_spec(&$params) {
}
/**
- * Return default values for settings. We will domain key this as it could vary by domain (ie. urls)
+ * Return default values for settings.
+ *
+ * We will domain key this as it could vary by domain (ie. urls)
* as we will be creating the option for a function rather than an value to be in the defaults
- * Note that is not in place as yet
+ * Note that is not in place as yet.
+ *
* @param array $params
+ *
* @return array
* @throws \CiviCRM_API3_Exception
* @throws \Exception
}
/**
- * Revert settings to defaults
+ * Revert settings to defaults.
+ *
* @param array $params
+ *
* @return array
* @throws \CiviCRM_API3_Exception
* @throws \Exception
$params['domain_id'] = array(
'api.default' => 'current_domain',
'title' => 'Setting Domain',
- 'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the current domain
- an array or "all" are acceptable values for multiple domains',
+ 'description' => 'Defaults may differ by domain - if you do not pass in a domain id this will default to the '
+ . 'current domain, an array or "all" are acceptable values for multiple domains',
);
}
}
/**
- * Metadata for setting create function
+ * Metadata for setting create function.
*
* @param array $params
* Parameters as passed to the API.
return civicrm_api3_create_success($result, $params, 'setting', 'get');
}
/**
- * Metadata for setting create function
+ * Metadata for setting create function.
*
* @param array $params
* Parameters as passed to the API.
);
}
/**
- * Returns value for specific parameter. Function requires more fields than 'get' but is intended for
+ * Returns value for specific parameter.
+ *
+ * Function requires more fields than 'get' but is intended for
* runtime usage & should be quicker
*
* @param array $params
- * (reference) Array of one or more valid.
+ * Array of one or more valid.
* property_name=>value pairs.
*
* @return array
- * Array of matching settings
- * {@getfields setting_get}
+ * API result array.
*/
function civicrm_api3_setting_getvalue($params) {
$config = CRM_Core_Config::singleton();
}
/**
- * Metadata for setting create function
+ * Metadata for setting create function.
*
* @param array $params
* Parameters as passed to the API.
}
/**
- * Converts domain input into an array. If an array is passed in this is used, if 'all' is passed
+ * Converts domain input into an array.
+ *
+ * If an array is passed in this is used, if 'all' is passed
* in this is converted to 'all arrays'
*
* Really domain_id should always be set but doing an empty check because at the moment
* using crm-editable will pass an id & default won't be applied
- * we did talk about id being a pseudonym for domain_id in this api so applying it here
+ * we did talk about id being a pseudonym for domain_id in this api so applying it here.
+ *
* @param array $params
+ *
* @return array
* @throws \Exception
*/
*
* @param array $params
* Array or parameters determined by getfields.
+ *
* @todo - suspect module, weight don't need to be required - need to test
*/
function _civicrm_api3_uf_join_create_spec(&$params) {
}
/**
- * Get CiviCRM UF_Joins (ie joins between CMS user records & CiviCRM user record
+ * Get CiviCRM UF_Joins (ie joins between CMS user records & CiviCRM user record.
*
* @param array $params
- * (reference) an assoc array of name/value pairs.
+ * Array of name/value pairs.
*
* @return array
- * CiviCRM Result Array or null
+ * API result array.
+ *
* @todo Delete function missing
*/
function civicrm_api3_uf_join_get($params) {
*/
/**
- * Add an Website for a contact.
+ * Add an Website for a contact.
*
* @param array $params
*
* @return array
- * Array of newly created website property values.
+ * API result array.
* @todo convert to using basic create - BAO function non-std
*/
function civicrm_api3_website_create($params) {