X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FBatch.php;h=93af82e0cc0eb8e02a91f12d3e22fa01116e6791;hb=85bb0909cffd925f4cd5c0022a68a1ff74d3ad8e;hp=8c5d69a2af3fb6dd6774823a8d39847acef9b22f;hpb=9c2e4fb9824d9913d19a7f7e24ada6093a409461;p=civicrm-core.git diff --git a/api/v3/Batch.php b/api/v3/Batch.php index 8c5d69a2af..93af82e0cc 100644 --- a/api/v3/Batch.php +++ b/api/v3/Batch.php @@ -2,9 +2,9 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.4 | + | CiviCRM version 4.5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2013 | + | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -41,6 +41,8 @@ * {@getfields batch_create} * @example BatchCreate.php * + * @param $params + * * @return array of newly created batch property values. * @access public */ @@ -48,6 +50,24 @@ function civicrm_api3_batch_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); } +/** + * Adjust Metadata for Create action + * + * The metadata is used for setting defaults, documentation & validation + * @param array $params array or parameters determined by getfields + */ +function _civicrm_api3_batch_create_spec(&$params) { + //@todo - the entity table field looks like it is not actually required & should probably be removed (or a description added if + // it is actually required) + $params['entity_table']['api.default'] = "civicrm_batch"; + $params['entity_table']['type'] = CRM_Utils_Type::T_STRING; + + $params['modified_date']['api.default'] = "now"; + $params['status_id']['api.required'] = 1; + $params['title']['api.required'] = 1; + $params['status_id']['api.required'] = 1; +} + /** * Get a Batch * @@ -55,6 +75,8 @@ function civicrm_api3_batch_create($params) { * {@getfields batch_get} * @example BatchCreate.php * + * @param $params + * * @return array of retrieved batch property values. * @access public */ @@ -69,6 +91,8 @@ function civicrm_api3_batch_get($params) { * {@getfields batch_delete} * @example BatchCreate.php * + * @param $params + * * @return array of deleted values. * @access public */