X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FBatch.php;h=1d6a4f95bc4114ca6d3cd6ae6d6d9a9869838256;hb=b67022d16d25106799f57d39e9301b3f00af619c;hp=64a03901b30897118442bce67b2c9fa94d679809;hpb=91a8f8b6ef4b0273a0c7cd70c2d34b1f1ecb9bf9;p=civicrm-core.git diff --git a/api/v3/Batch.php b/api/v3/Batch.php index 64a03901b3..1d6a4f95bc 100644 --- a/api/v3/Batch.php +++ b/api/v3/Batch.php @@ -2,9 +2,9 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.3 | + | CiviCRM version 4.5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2013 | + | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -48,6 +48,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 *