X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FGroupNestingCache.php;h=80a2cfcaf55a2a2f6328f26d884c2f1430ae869d;hb=6594935cdf40a89db938cab053596b776e011bc7;hp=ff95b8e39e4e57dbfc54d02d68f07f5255e06ad0;hpb=8906b92a00b4907e620e80624fb6ac6baa368bed;p=civicrm-core.git diff --git a/CRM/Contact/BAO/GroupNestingCache.php b/CRM/Contact/BAO/GroupNestingCache.php index ff95b8e39e..80a2cfcaf5 100644 --- a/CRM/Contact/BAO/GroupNestingCache.php +++ b/CRM/Contact/BAO/GroupNestingCache.php @@ -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');