+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
/**
- * File for the CiviCRM APIv3 product functions
+ * This api exposes CiviCRM premium products.
+ *
+ * Premiums are used as incentive gifts on contribution pages.
+ * Use chaining to create a premium and related products in one api call.
*
* @package CiviCRM_APIv3
- * @subpackage API_product
*/
/**
*
* @throws API_Exception
* @return array
- * Array of newly created product property values.
*/
function civicrm_api3_product_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 of parameters determined by getfields.
+ */
+function _civicrm_api3_product_create_spec(&$params) {
+ $params['is_active']['api.default'] = 1;
+}
+
/**
* Get a product.
*