fix new regression on payment block not showing
[civicrm-core.git] / Civi / CCase / Analyzer.php
index cc82918dfba69b231eef0dcecc557ee34f3fc70b..518c3768e4f9ec15976c0e45702a33509f9f0f9a 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 namespace Civi\CCase;
 
+/**
+ * Class Analyzer
+ *
+ * @package Civi\CCase
+ */
 class Analyzer {
   /**
    * @var int
@@ -57,6 +62,9 @@ class Analyzer {
    */
   private $indices;
 
+  /**
+   * @param $caseId
+   */
   public function __construct($caseId) {
     $this->caseId = $caseId;
     $this->flush();
@@ -65,8 +73,10 @@ class Analyzer {
   /**
    * Determine if case includes an activity of given type/status
    *
-   * @param string $type eg "Phone Call", "Interview Prospect", "Background Check"
-   * @param string $status eg "Scheduled", "Completed"
+   * @param string $type
+   *   Eg "Phone Call", "Interview Prospect", "Background Check".
+   * @param string $status
+   *   Eg "Scheduled", "Completed".
    * @return bool
    */
   public function hasActivity($type, $status = NULL) {
@@ -82,7 +92,7 @@ class Analyzer {
       $activityStatusGroup = civicrm_api3('option_group', 'get', array('name' => 'activity_status'));
       $activityStatus = array(
         'name' => $status,
-        'option_group_id' => $activityStatusGroup['id']
+        'option_group_id' => $activityStatusGroup['id'],
       );
       $activityStatusID = civicrm_api3('option_value', 'get', $activityStatus);
       $activityStatusID = $activityStatusID['values'][$activityStatusID['id']]['value'];
@@ -96,9 +106,10 @@ class Analyzer {
   }
 
   /**
-   * Get a list of all activities in the case
+   * Get a list of all activities in the case.
    *
-   * @return array list of activity records (api/v3 format)
+   * @return array
+   *   list of activity records (api/v3 format)
    */
   public function getActivities() {
     if ($this->activities === NULL) {
@@ -120,7 +131,7 @@ class Analyzer {
   }
 
   /**
-   * Get a single activity record by type
+   * Get a single activity record by type.
    *
    * @param string $type
    * @throws \Civi\CCase\Exception\MultipleActivityException
@@ -180,8 +191,10 @@ class Analyzer {
   /**
    * Get a list of all activities in the case (indexed by some property/properties)
    *
-   * @param array $keys list of properties by which to index activities
-   * @return array list of activity records (api/v3 format), indexed by $keys
+   * @param array $keys
+   *   List of properties by which to index activities.
+   * @return array
+   *   list of activity records (api/v3 format), indexed by $keys
    */
   public function getActivityIndex($keys) {
     $key = implode(";", $keys);
@@ -202,7 +215,7 @@ class Analyzer {
   }
 
   /**
-   * Flush any cached information
+   * Flush any cached information.
    *
    * @return void
    */
@@ -212,4 +225,5 @@ class Analyzer {
     $this->activities = NULL;
     $this->indices = array();
   }
+
 }