Beispiel #1
0
 public static function getAll()
 {
     if (self::$_groups === null) {
         self::$_groups = tables\Groups::getTable()->getAll();
     }
     return self::$_groups;
 }
Beispiel #2
0
 protected function _initialize()
 {
     parent::_setup(self::B2DBNAME, self::ID);
     parent::_addBoolean(self::CONFIRMED);
     parent::_addForeignKeyColumn(self::USER_ID, Users::getTable(), Users::ID);
     parent::_addForeignKeyColumn(self::GROUP_ID, Groups::getTable(), Groups::ID);
 }
Beispiel #3
0
 protected function _initialize()
 {
     parent::_setup(self::B2DBNAME, self::ID);
     parent::_addVarchar(self::PERMISSION_TYPE, 100);
     parent::_addVarchar(self::TARGET_ID, 200, 0);
     parent::_addBoolean(self::ALLOWED);
     parent::_addVarchar(self::MODULE, 50);
     parent::_addForeignKeyColumn(self::UID, Users::getTable());
     parent::_addForeignKeyColumn(self::GID, Groups::getTable());
     parent::_addForeignKeyColumn(self::TID, Teams::getTable());
     parent::_addForeignKeyColumn(self::ROLE_ID, ListTypes::getTable());
 }
Beispiel #4
0
 /**
  * Returns the user group
  *
  * @return Group
  */
 public function getGroup()
 {
     if (!is_object($this->_group_id)) {
         try {
             if (!is_numeric($this->_group_id)) {
                 $this->_group_id = tables\UserScopes::getTable()->getUserGroupIdByScope($this->getID(), framework\Context::getScope()->getID());
             }
             if (!is_numeric($this->_group_id)) {
                 $this->_group_id = framework\Settings::getDefaultGroup();
             } else {
                 $this->_group_id = tables\Groups::getTable()->selectById($this->_group_id);
             }
         } catch (\Exception $e) {
         }
     }
     return $this->_group_id;
 }