Changeset 899 for trunk/Modules/News/News.php
- Timestamp:
- Feb 17, 2021, 12:30:23 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/News.php
r894 r899 11 11 } 12 12 13 class ModuleNews extends AppModule13 class ModuleNews extends Module 14 14 { 15 15 public int $NewsCountPerCategory = 3; … … 22 22 $this->Version = '1.0'; 23 23 $this->Creator = 'Chronos'; 24 $this->License = 'GNU/GPL ';24 $this->License = 'GNU/GPLv3'; 25 25 $this->Description = 'News and news groups management'; 26 $this->Dependencies = array( 'User', 'Log', 'File');26 $this->Dependencies = array(ModuleUser::GetName(), ModuleLog::GetName(), ModuleFile::GetName()); 27 27 $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()); 33 29 } 34 30 … … 272 268 } 273 269 274 static function Cast( AppModule $AppModule): ModuleNews275 { 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)); 281 277 } 282 278 } … … 284 280 class News extends Model 285 281 { 286 static function Get Desc(): ModelDesc282 static function GetModelDesc(): ModelDesc 287 283 { 288 284 $Desc = new ModelDesc(self::GetClassName()); … … 302 298 class NewsCategory extends Model 303 299 { 304 static function Get Desc(): ModelDesc300 static function GetModelDesc(): ModelDesc 305 301 { 306 302 $Desc = new ModelDesc(self::GetClassName());
Note:
See TracChangeset
for help on using the changeset viewer.