Merge pull request #5327 from colemanw/totten-master-headerlist
[civicrm-core.git] / api / v3 / Premium.php
index 89826298d6a22a283a51f26e5baac3469ec14d71..2ae0961de388bd54a48861d80b6a52d33229e271 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
- * File for the CiviCRM APIv3 premium functions
+ * This api exposes CiviCRM premiums.
  *
- * @package CiviCRM_APIv3
- * @subpackage API_premium
+ * Premiums are used as incentive gifts on contribution pages.
+ * Premiums contain "Products" which has a separate api.
+ * Use chaining to create a premium and related products in one api call.
  *
+ * @package CiviCRM_APIv3
  */
 
 /**
- * Save a premium
- *
- * Allowed @params array keys are:
- * {@getfields premium_create}
- * @example premiumCreate.php
+ * Save a premium.
  *
  * @param array $params
  *
  * @throws API_Exception
  * @return array
- *   Array of newly created premium property values.
- * @access public
  */
 function civicrm_api3_premium_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Get a premium
- *
- * Allowed @params array keys are:
- * {@getfields premium_get}
- * @example premiumCreate.php
+ * Get a premium.
  *
  * @param array $params
  *
  * @return array
  *   Array of retrieved premium property values.
- * @access public
  */
 function civicrm_api3_premium_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Delete a premium
- *
- * Allowed @params array keys are:
- * {@getfields premium_delete}
- * @example premiumCreate.php
+ * Delete a premium.
  *
  * @param array $params
  *
  * @throws API_Exception
  * @return array
  *   Array of deleted values.
- * @access public
  */
 function civicrm_api3_premium_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * return field specification specific to get requests
+ * Return field specification specific to get requests.
+ *
+ * @param array $params
  */
 function _civicrm_api3_premium_get_spec(&$params) {
   $params['premiums_active']['api.aliases'] = array('is_active');
 }
 
 /**
- * return field specification specific to create requests
+ * Return field specification specific to create requests.
+ *
+ * @param array $params
  */
 function _civicrm_api3_premium_create_spec(&$params) {
   $params['premiums_active']['api.aliases'] = array('is_active');