projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #4724 from atif-shaikh/CRM-15598
[civicrm-core.git]
/
CRM
/
Contact
/
BAO
/
GroupNestingCache.php
diff --git
a/CRM/Contact/BAO/GroupNestingCache.php
b/CRM/Contact/BAO/GroupNestingCache.php
index ff95b8e39e4e57dbfc54d02d68f07f5255e06ad0..80a2cfcaf55a2a2f6328f26d884c2f1430ae869d 100644
(file)
--- 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');
}
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
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;
}
return FALSE;
}
+ /**
+ * @param $tree
+ * @param int $id
+ *
+ * @return bool
+ */
static function isCyclic(&$tree, $id) {
$parents = $children = array();
self::getAll($parent, $tree, $id, 'parents');
static function isCyclic(&$tree, $id) {
$parents = $children = array();
self::getAll($parent, $tree, $id, 'parents');
@@
-129,6
+140,12
@@
WHERE id = $id
return FALSE;
}
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');
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);
}
return array_keys($potential);
}
+ /**
+ * @param $potential
+ * @param $tree
+ * @param int $id
+ * @param $token
+ */
static function invalidate(&$potential, &$tree, $id, $token) {
unset($potential[$id]);
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])) {
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');
static function json() {
$tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy');