diff options
Diffstat (limited to 'library')
-rw-r--r-- | library/Pbs/Graph.php | 7 | ||||
-rw-r--r-- | library/Pbs/Pagination.php | 2 |
2 files changed, 8 insertions, 1 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); diff --git a/library/Pbs/Pagination.php b/library/Pbs/Pagination.php index c31dacf..0be192c 100644 --- a/library/Pbs/Pagination.php +++ b/library/Pbs/Pagination.php @@ -74,7 +74,7 @@ class Pbs_Pagination{ return $this->requestpage * $this->perpage; } public function getElements(){ - return array_slice($this->element,$this->getStartItem(),$this->getPerPage()); + return array_slice($this->element,$this->getStartItem(),$this->getPerPage(),true); } public function setPageUrl($url){ $this->pageUrl = $url; |