Api docblock cleanup.
[civicrm-core.git] / api / v3 / Survey.php
index 7e6a17d1dc3358c566019d6cff788c3ab899eb5b..9bd314aed34fef833303ae4a809460743cb3528b 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  */
 
 /**
- * File for the CiviCRM APIv3 group functions
+ * This api exposes CiviCRM survey/petition records.
+ *
+ * @note Campaign component must be enabled.
+ * @note There is no "petition" api.
+ * Surveys and petitions are the same basic object and this api is used for both.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_Survey
- * @copyright CiviCRM LLC (c) 2004-2014
  */
 
 
 /**
- * Create or update a survey
+ * Create or update a survey.
  *
- * @param array $params  Associative array of property
- *                       name/value pairs to insert in new 'survey'
- * @example SurveyCreate.php Std Create example
+ * @param array $params
+ *   Array per getfields metadata.
  *
- * @return array api result array
- * {@getfields survey_create}
- * @access public
+ * @return array
+ *   api result array
  */
 function civicrm_api3_survey_create($params) {
-  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Survey');
 }
 
 /**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action.
  *
- * The metadata is used for setting defaults, documentation & validation
- * @param array $params array or parameters determined by getfields
+ * The metadata is used for setting defaults, documentation & validation.
+ *
+ * @param array $params
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_survey_create_spec(&$params) {
   $params['title']['api.required'] = 1;
 }
 
 /**
- * Returns array of surveys  matching a set of one or more group properties
+ * Returns array of surveys  matching a set of one or more group properties.
  *
- * @param array $params Array of one or more valid
- *                       property_name=>value pairs. If $params is set
- *                       as null, all surveys will be returned
+ * @param array $params
+ *   Array of properties. If empty, all records will be returned.
  *
- * @return array  API result Array of matching surveys
- * {@getfields survey_get}
- * @access public
+ * @return array
+ *   API result Array of matching surveys
  */
 function civicrm_api3_survey_get($params) {
-  return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+  return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Survey');
 }
 
 /**
- * delete an existing survey
+ * Delete an existing survey.
  *
  * This method is used to delete any existing survey. id of the group
  * to be deleted is required field in $params array
  *
- * @param array $params array containing id of the group
- *                       to be deleted
+ * @param array $params
+ *   [id]
  *
- * @return array api result array
- * {@getfields survey_delete}
- * @access public
+ * @return array
+ *   api result array
  */
 function civicrm_api3_survey_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
-