Merge pull request #5185 from colemanw/revertExamples
[civicrm-core.git] / api / v3 / MailingEventSubscribe.php
index 3403e66a55c40c318a74bfb7faf9619586a33ed9..ac82084461ed59a313f481c11ffe37decb832d3a 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        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * APIv3 functions for registering/processing mailing group events.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_MailerGroup
- * @copyright CiviCRM LLC (c) 2004-2014
- * $Id$
- *
  */
 
 /**
- * Subscribe from mailing group
+ * Subscribe from mailing group.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'survey'
+ *   Array per getfields metadata.
  *
  * @throws API_Exception
  * @return array
  *   api result array
- * {@getfields mailing_event_subscribe_create}
- * @access public
  */
 function civicrm_api3_mailing_event_subscribe_create($params) {
   $email      = $params['email'];
@@ -57,7 +49,7 @@ function civicrm_api3_mailing_event_subscribe_create($params) {
 
   $group            = new CRM_Contact_DAO_Group();
   $group->is_active = 1;
-  $group->id        = (int)$group_id;
+  $group->id        = (int) $group_id;
   if (!$group->find(TRUE)) {
     throw new API_Exception('Invalid Group id');
   }
@@ -67,7 +59,6 @@ function civicrm_api3_mailing_event_subscribe_create($params) {
   if ($subscribe !== NULL) {
     /* Ask the contact for confirmation */
 
-
     $subscribe->send_confirm_request($email);
 
     $values = array();
@@ -81,11 +72,12 @@ function civicrm_api3_mailing_event_subscribe_create($params) {
 }
 
 /**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
  *
- * The metadata is used for setting defaults, documentation & validation
  * @param array $params
- *   Array or parameters determined by getfields.
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_mailing_event_subscribe_create_spec(&$params) {
   $params['email']['api.required'] = 1;