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

Legend:

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

    r894 r899  
    1111}
    1212
    13 class ModuleNews extends AppModule
     13class ModuleNews extends Module
    1414{
    1515  public int $NewsCountPerCategory = 3;
     
    2222    $this->Version = '1.0';
    2323    $this->Creator = 'Chronos';
    24     $this->License = 'GNU/GPL';
     24    $this->License = 'GNU/GPLv3';
    2525    $this->Description = 'News and news groups management';
    26     $this->Dependencies = array('User', 'Log', 'File');
     26    $this->Dependencies = array(ModuleUser::GetName(), ModuleLog::GetName(), ModuleFile::GetName());
    2727    $this->SupportedModules = array('Search');
    28   }
    29 
    30   function GetModels(): array
    31   {
    32     return array(NewsCategory::GetClassName(), News::GetClassName());
     28    $this->Models = array(NewsCategory::GetClassName(), News::GetClassName());
    3329  }
    3430
     
    272268  }
    273269
    274   static function Cast(AppModule $AppModule): ModuleNews
    275   {
    276     if ($AppModule instanceof ModuleNews)
    277     {
    278       return $AppModule;
    279     }
    280     throw new Exception('Expected ModuleNews type but got '.gettype($AppModule));
     270  static function Cast(Module $Module): ModuleNews
     271  {
     272    if ($Module instanceof ModuleNews)
     273    {
     274      return $Module;
     275    }
     276    throw new Exception('Expected ModuleNews type but got '.gettype($Module));
    281277  }
    282278}
     
    284280class News extends Model
    285281{
    286   static function GetDesc(): ModelDesc
     282  static function GetModelDesc(): ModelDesc
    287283  {
    288284    $Desc = new ModelDesc(self::GetClassName());
     
    302298class NewsCategory extends Model
    303299{
    304   static function GetDesc(): ModelDesc
     300  static function GetModelDesc(): ModelDesc
    305301  {
    306302    $Desc = new ModelDesc(self::GetClassName());
Note: See TracChangeset for help on using the changeset viewer.