Merge pull request #2350 from eileenmcnaughton/CRM-14012
[civicrm-core.git] / api / v3 / Batch.php
index 1fc7f84d2917b573aa59caa0794c09151e2ca74a..9fb57204fd7a137dab282397cedb59c16f49d17a 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-// $Id$
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -49,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
  *