/** * returns a list of all friendgroups * @return */ function getAllFriendGroups($aUserid) { $groups = array(); $uf = new UserFactory(); $lst1 = $uf->getFriendUsers($aUserid); if ($lst1 != null) { for ($i = 0; $i < count($lst1); $i++) { $lst1[$i]->prepareForTree_virtual("__Friends"); $lst2 = $this->getFriendGroups($lst1[$i]->itemid); if ($lst2 != null) { for ($x = 0; $x < count($lst2); $x++) { $lst2[$x]->prepareForTree_virtual($lst1[$i]->id); $this->updateFriendItems($lst2[$x]); array_push($groups, $lst2[$x]); } } } return $groups; } return null; }