summaryrefslogtreecommitdiffstats
path: root/library/Pbs/Graph.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/Pbs/Graph.php')
-rw-r--r--library/Pbs/Graph.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/Pbs/Graph.php b/library/Pbs/Graph.php
index 3b20cea..521275d 100644
--- a/library/Pbs/Graph.php
+++ b/library/Pbs/Graph.php
@@ -7,6 +7,7 @@ class Pbs_Graph{
private $graphstring;
private $level;
private $edges;
+ private $crawledNodes;
public function graph($groupID)
{
@@ -40,6 +41,9 @@ class Pbs_Graph{
}
private function getParentGroups($groupID, $level=1) {
+ if($this->crawledNodes['parent'][$groupID] == 1)
+ return;
+ $this->crawledNodes['parent'][$groupID] = 1;
$db = Zend_Db_Table::getDefaultAdapter();
$query = 'SELECT parentID FROM pbs_groupgroups WHERE groupID="'.$groupID.'"';
$stmt = $db->query($query);
@@ -58,6 +62,9 @@ class Pbs_Graph{
// Gets all childs-groups from a given group
private function getChildGroups($groupID, $level=1) {
+ if($this->crawledNodes['child'][$groupID] == 1)
+ return;
+ $this->crawledNodes['child'][$groupID] = 1;
$db = Zend_Db_Table::getDefaultAdapter();
$query = 'SELECT groupID FROM pbs_groupgroups WHERE parentID="'.$groupID.'"';
$stmt = $db->query($query);