Exemplo n.º 1
0
 public static function getAll()
 {
     if (self::$_userstates === null) {
         self::$_userstates = TBGUserStateTable::getTable()->getAll();
     }
     return self::$_userstates;
 }
 public static function getAll()
 {
     if (self::$_userstates === null) {
         if (!($states = TBGCache::get(TBGCache::KEY_USERSTATES_CACHE))) {
             $res = TBGUserStateTable::getTable()->doSelectAll();
             $states = array();
             while ($row = $res->getNextRow()) {
                 $states[$row->get(TBGUserStateTable::ID)] = TBGContext::factory()->TBGUserstate($row->get(TBGUserStateTable::ID), $row);
             }
             TBGCache::add(TBGCache::KEY_USERSTATES_CACHE, $states);
         }
         self::$_userstates = $states;
     }
     return self::$_userstates;
 }
 protected function _initialize()
 {
     parent::_setup(self::B2DBNAME, self::ID);
     parent::_addVarchar(self::UNAME, 50);
     parent::_addVarchar(self::PASSWORD, 50);
     parent::_addVarchar(self::BUDDYNAME, 50);
     parent::_addVarchar(self::REALNAME, 100);
     parent::_addVarchar(self::EMAIL, 200);
     parent::_addBoolean(self::CUSTOMSTATE);
     parent::_addVarchar(self::HOMEPAGE, 250, '');
     parent::_addVarchar(self::LANGUAGE, 100, '');
     parent::_addInteger(self::LASTSEEN, 10);
     parent::_addInteger(self::QUOTA);
     parent::_addBoolean(self::ACTIVATED);
     parent::_addBoolean(self::ENABLED);
     parent::_addBoolean(self::DELETED);
     parent::_addVarchar(self::AVATAR, 30, '');
     parent::_addBoolean(self::USE_GRAVATAR, true);
     parent::_addBoolean(self::PRIVATE_EMAIL);
     parent::_addInteger(self::JOINED, 10);
     parent::_addForeignKeyColumn(self::USERSTATE, TBGUserStateTable::getTable(), TBGUserStateTable::ID);
     parent::_addForeignKeyColumn(self::GROUP_ID, TBGGroupsTable::getTable(), TBGGroupsTable::ID);
     parent::_addForeignKeyColumn(self::SCOPE, TBGScopesTable::getTable(), TBGScopesTable::ID);
 }