Changeset 899 for trunk/Modules/File


Ignore:
Timestamp:
Feb 17, 2021, 12:30:23 PM (4 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

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

    r894 r899  
    1313  }
    1414
    15   static function GetDesc(): ModelDesc
     15  static function GetModelDesc(): ModelDesc
    1616  {
    1717    $Desc = new ModelDesc('File');
     
    116116class FileDirectory extends Model
    117117{
    118   static function GetDesc(): ModelDesc
     118  static function GetModelDesc(): ModelDesc
    119119  {
    120120    $Desc = new ModelDesc('FileDirectory');
     
    175175}
    176176
    177 class ModuleFile extends AppModule
     177class ModuleFile extends Module
    178178{
    179179  public File $File;
     
    187187    $this->License = 'GNU/GPLv3';
    188188    $this->Description = 'Base module for file management';
    189     $this->Dependencies = array('User');
     189    $this->Dependencies = array(ModuleUser::GetName());
     190    $this->Models = array(FileDirectory::GetClassName(), File::GetClassName());
    190191
    191192    $this->File = new File($this->System);
    192   }
    193 
    194   function GetModels(): array
    195   {
    196     return array(FileDirectory::GetClassName(), File::GetClassName());
    197193  }
    198194
     
    292288  }
    293289
    294   static function Cast(AppModule $AppModule): ModuleFile
    295   {
    296     if ($AppModule instanceof ModuleFile)
    297     {
    298       return $AppModule;
    299     }
    300     throw new Exception('Expected ModuleFile type but got '.gettype($AppModule));
    301   }
    302 }
     290  static function Cast(Module $Module): ModuleFile
     291  {
     292    if ($Module instanceof ModuleFile)
     293    {
     294      return $Module;
     295    }
     296    throw new Exception('Expected ModuleFile type but got '.gettype($Module));
     297  }
     298}
Note: See TracChangeset for help on using the changeset viewer.