INFRA-132 comments to end with full stops
[civicrm-core.git] / CRM / Campaign / BAO / Campaign.php
index 4513a35e115756388bca7b81e91405e869217ced..2261f3a15b1f1e00238e754a95b65e1dd140d241 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -35,7 +35,7 @@
 class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
 
   /**
-   * Takes an associative array and creates a campaign object
+   * Takes an associative array and creates a campaign object.
    *
    * the function extract all the params it needs to initialize the create a
    * contact object. the params array could contain additional unused name/value
@@ -45,11 +45,10 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
    *   (reference ) an assoc array of name/value pairs.
    *
    * @return CRM_Campaign_DAO_Campaign
-   * @static
    */
   public static function create(&$params) {
     if (empty($params)) {
-      return;
+      return NULL;
     }
 
     if (!(CRM_Utils_Array::value('id', $params))) {
@@ -99,7 +98,7 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
   }
 
   /**
-   * Delete the campaign
+   * Delete the campaign.
    *
    * @param int $id
    *   Id of the campaign.
@@ -116,9 +115,9 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
   }
 
   /**
-   * Takes a bunch of params that are needed to match certain criteria and
-   * retrieves the relevant objects. Typically the valid params are only
-   * campaign_id.
+   * Retrieve DB object based on input parameters.
+   *
+   * It also stores all the retrieved values in the default array.
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
@@ -155,7 +154,6 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
    *
    * @return mixed
    *   $campaigns a set of campaigns.
-   * @access public
    */
   public static function getCampaigns(
     $includeId = NULL,
@@ -240,6 +238,17 @@ Order By  camp.title";
   /**
    * Wrapper to self::getCampaigns( )
    * w/ permissions and component check.
+   *
+   * @param int $includeId
+   * @param int $excludeId
+   * @param bool $onlyActive
+   * @param bool $onlyCurrent
+   * @param bool $appendDatesToTitle
+   * @param bool $forceAll
+   * @param bool $doCheckForComponent
+   * @param bool $doCheckForPermissions
+   *
+   * @return mixed
    */
   public static function getPermissionedCampaigns(
     $includeId = NULL,
@@ -328,7 +337,6 @@ Order By  camp.title";
   /**
    * Retrieve campaigns for dashboard.
    *
-   * @static
    */
   public static function getCampaignSummary($params = array(), $onlyCount = FALSE) {
     $campaigns = array();
@@ -475,20 +483,18 @@ SELECT  campaign.id               as id,
   /**
    * Get the campaign count.
    *
-   * @static
    */
   public static function getCampaignCount() {
     return (int) CRM_Core_DAO::singleValueQuery('SELECT COUNT(*) FROM civicrm_campaign');
   }
 
   /**
-   * Get Campaigns groups
+   * Get Campaigns groups.
    *
    * @param int $campaignId
    *   Campaign id.
    *
    * @return array
-   * @static
    */
   public static function getCampaignGroups($campaignId) {
     static $campaignGroups;
@@ -517,16 +523,15 @@ INNER JOIN  civicrm_group grp ON ( grp.id = campgrp.entity_id )
   }
 
   /**
-   * Update the is_active flag in the db
+   * Update the is_active flag in the db.
    *
    * @param int $id
    *   Id of the database record.
    * @param bool $is_active
    *   Value we want to set the is_active field.
    *
-   * @return Object
+   * @return CRM_Campaign_DAO_Campaign|null
    *   DAO object on sucess, null otherwise
-   * @static
    */
   public static function setIsActive($id, $is_active) {
     return CRM_Core_DAO::setFieldValue('CRM_Campaign_DAO_Campaign', $id, 'is_active', $is_active);
@@ -550,11 +555,10 @@ INNER JOIN  civicrm_group grp ON ( grp.id = campgrp.entity_id )
     return $allow;
   }
 
-  /*
+  /**
    * Add select element for campaign
    * and assign needful info to templates.
-   */
-  /**
+   *
    * @param CRM_Core_Form $form
    * @param int $connectedCampaignId
    */
@@ -639,7 +643,7 @@ INNER JOIN  civicrm_group grp ON ( grp.id = campgrp.entity_id )
   }
 
   /**
-   * Add campaign in compoent search.
+   * Add campaign in component search.
    * and assign needful info to templates.
    *
    * @param CRM_Core_Form $form
@@ -681,4 +685,5 @@ INNER JOIN  civicrm_group grp ON ( grp.id = campgrp.entity_id )
     }
     $form->assign('campaignInfo', $campaignInfo);
   }
+
 }