Merge pull request #4768 from rohankatkar/CRM-10331Fix
[civicrm-core.git] / CRM / Contact / BAO / GroupNestingCache.php
index 14e76f95ecabef0302880af14d5e3f2ecb562930..80a2cfcaf55a2a2f6328f26d884c2f1430ae869d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -97,6 +97,11 @@ WHERE  id = $id
     CRM_Core_BAO_Cache::setItem($tree, 'contact groups', 'nestable tree hierarchy');
   }
 
+  /**
+   * @param $tree
+   *
+   * @return bool
+   */
   static function checkCyclicGraph(&$tree) {
     // lets keep this simple, we should probably use a graph algoritm here at some stage
 
@@ -111,6 +116,12 @@ WHERE  id = $id
     return FALSE;
   }
 
+  /**
+   * @param $tree
+   * @param int $id
+   *
+   * @return bool
+   */
   static function isCyclic(&$tree, $id) {
     $parents = $children = array();
     self::getAll($parent, $tree, $id, 'parents');
@@ -129,6 +140,12 @@ WHERE  id = $id
     return FALSE;
   }
 
+  /**
+   * @param int $id
+   * @param $groups
+   *
+   * @return array
+   */
   static function getPotentialCandidates($id, &$groups) {
     $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy');
 
@@ -148,6 +165,12 @@ WHERE  id = $id
     return array_keys($potential);
   }
 
+  /**
+   * @param $potential
+   * @param $tree
+   * @param int $id
+   * @param $token
+   */
   static function invalidate(&$potential, &$tree, $id, $token) {
     unset($potential[$id]);
 
@@ -162,6 +185,12 @@ WHERE  id = $id
     }
   }
 
+  /**
+   * @param $all
+   * @param $tree
+   * @param int $id
+   * @param $token
+   */
   static function getAll(&$all, &$tree, $id, $token) {
     // if seen before, dont do anything
     if (isset($all[$id])) {
@@ -180,6 +209,9 @@ WHERE  id = $id
     }
   }
 
+  /**
+   * @return string
+   */
   static function json() {
     $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy');