Changeset 894 for trunk/Modules/User


Ignore:
Timestamp:
Jan 5, 2021, 10:30:31 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Further improved models initialization system.
Location:
trunk/Modules/User
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/User.php

    r893 r894  
    2525  function GetModels(): array
    2626  {
    27     return array('User', 'UserOnline', 'PermissionGroup', 'PermissionOperation', 'PermissionGroupAssignment', 'PermissionUserAssignment');
     27    return array(User::GetClassName(), UserOnline::GetClassName(), PermissionGroup::GetClassName(), PermissionOperation::GetClassName(),
     28      PermissionGroupAssignment::GetClassName(), PermissionUserAssignment::GetClassName());
    2829  }
    2930
  • trunk/Modules/User/UserModel.php

    r891 r894  
    6767  static function GetDesc(): ModelDesc
    6868  {
    69     $Desc = new ModelDesc('User');
     69    $Desc = new ModelDesc(self::GetClassName());
    7070    $Column = $Desc->AddString('Login');
    7171    $Column->Unique = true;
     
    458458  static function GetDesc(): ModelDesc
    459459  {
    460     $Desc = new ModelDesc('UserOnline');
     460    $Desc = new ModelDesc(self::GetClassName());
    461461    $Desc->Memory = true;
    462     $Desc->AddReference('User', 'User', true);
     462    $Desc->AddReference('User', User::GetClassName(), true);
    463463    $Desc->AddDateTime('ActivityTime');
    464464    $Desc->AddDateTime('LoginTime');
     
    477477  static function GetDesc(): ModelDesc
    478478  {
    479     $Desc = new ModelDesc('PermissionGroup');
     479    $Desc = new ModelDesc(self::GetClassName());
    480480    $Desc->AddString('Description');
    481481    return $Desc;
     
    487487  static function GetDesc(): ModelDesc
    488488  {
    489     $Desc = new ModelDesc('PermissionGroupAssignment');
    490     $Desc->AddReference('Group', 'PermissionGroup');
    491     $Desc->AddReference('AssignedGroup', 'PermissionGroup', true);
    492     $Desc->AddReference('AssignedOperation', 'PermissionOperation', true);
     489    $Desc = new ModelDesc(self::GetClassName());
     490    $Desc->AddReference('Group', PermissionGroup::GetClassName());
     491    $Desc->AddReference('AssignedGroup', PermissionGroup::GetClassName(), true);
     492    $Desc->AddReference('AssignedOperation', PermissionOperation::GetClassName(), true);
    493493    return $Desc;
    494494  }
     
    499499  static function GetDesc(): ModelDesc
    500500  {
    501     $Desc = new ModelDesc('PermissionOperation');
    502     $Desc->AddReference('Module', 'Module');
     501    $Desc = new ModelDesc(self::GetClassName());
     502    $Desc->AddReference('Module', Module::GetClassName());
    503503    $Desc->AddString('Operation');
    504504    $Desc->AddString('Item');
     
    513513  static function GetDesc(): ModelDesc
    514514  {
    515     $Desc = new ModelDesc('PermissionUserAssignment');
    516     $Desc->AddReference('User', 'User');
    517     $Desc->AddReference('AssignedGroup', 'PermissionGroup', true);
    518     $Desc->AddReference('AssignedOperation', 'PermissionOperation', true);
     515    $Desc = new ModelDesc(self::GetClassName());
     516    $Desc->AddReference('User', User::GetClassName());
     517    $Desc->AddReference('AssignedGroup', PermissionGroup::GetClassName(), true);
     518    $Desc->AddReference('AssignedOperation', PermissionOperation::GetClassName(), true);
    519519    return $Desc;
    520520  }
Note: See TracChangeset for help on using the changeset viewer.