<?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. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $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
return FALSE;
}
+ /**
+ * @param $tree
+ * @param int $id
+ *
+ * @return bool
+ */
static function isCyclic(&$tree, $id) {
$parents = $children = array();
self::getAll($parent, $tree, $id, 'parents');
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');
return array_keys($potential);
}
+ /**
+ * @param $potential
+ * @param $tree
+ * @param int $id
+ * @param $token
+ */
static function invalidate(&$potential, &$tree, $id, $token) {
unset($potential[$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])) {
}
}
+ /**
+ * @return string
+ */
static function json() {
$tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy');