Changeset 890 for trunk/Modules/File


Ignore:
Timestamp:
Dec 29, 2020, 11:11:12 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Modules dependencies evaluation.
  • Modified: Better installation/uninstallation of models in more modules.
File:
1 edited

Legend:

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

    r887 r890  
    1111    parent::__construct($System);
    1212    $this->FilesDir = '';
     13  }
     14
     15  static function GetDesc(): ModelDesc
     16  {
     17    $Desc = new ModelDesc('File');
     18    $Desc->AddString('Name');
     19    $Desc->AddInteger('Size');
     20    $Column = $Desc->AddReference('Directory', 'FileDirectory');
     21    $Column->Nullable = true;
     22    $Desc->AddDateTime('Time');   
     23    return $Desc;
    1324  }
    1425
     
    104115}
    105116
     117class FileDirectory extends Model
     118{
     119  static function GetDesc(): ModelDesc
     120  {
     121    $Desc = new ModelDesc('FileDirectory');
     122    $Desc->AddString('Name');
     123    $Column = $Desc->AddReference('Parent', 'FileDirectory');
     124    $Column->Nullable = true;
     125    return $Desc;
     126  }
     127}
     128
    106129class PageFileCheck extends Page
    107130{
     
    173196  function DoInstall(): void
    174197  {
     198    $this->InstallModel(FileDirectory::GetDesc());
     199    $this->InstallModel(File::GetDesc());
    175200  }
    176201
    177202  function DoUninstall(): void
    178203  {
     204    $this->UninstallModel(File::GetDesc());
     205    $this->UninstallModel(FileDirectory::GetDesc());
    179206  }
    180207
Note: See TracChangeset for help on using the changeset viewer.