Ignore:
Timestamp:
Dec 22, 2020, 11:34:19 PM (4 years ago)
Author:
chronos
Message:
  • Added: Install and uninstall modules models persistence using abstract classes.
File:
1 edited

Legend:

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

    r887 r889  
    3131  {
    3232    $this->System->RegisterPage(['api'], 'PageAPI');
     33  }
     34
     35  function DoInstall(): void
     36  {
     37    $this->InstallModel(APIToken::GetDesc());
     38  }
     39
     40  function DoUninstall(): void
     41  {
     42    $this->UninstallModel(APIToken::GetDesc());
     43  }
     44}
     45
     46class ApiToken extends Model
     47{
     48  static function GetDesc(): ModelDesc
     49  {
     50    $Desc = new ModelDesc('APIToken');
     51    $Desc->AddReference('User', 'User');
     52    $Desc->AddString('Token');
     53    return $Desc;
    3354  }
    3455}
Note: See TracChangeset for help on using the changeset viewer.