public static function getAll() { if (self::$_groups === null) { self::$_groups = array(); if ($res = TBGGroupsTable::getTable()->getAll()) { while ($row = $res->getNextRow()) { self::$_groups[$row->get(TBGGroupsTable::ID)] = TBGContext::factory()->TBGGroup($row->get(TBGGroupsTable::ID), $row); } } } return self::$_groups; }