Changeset 894 for trunk/Modules/News/News.php
- Timestamp:
- Jan 5, 2021, 10:30:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/News.php
r893 r894 30 30 function GetModels(): array 31 31 { 32 return array('NewsCategory', 'News'); 33 } 34 35 function DoInstall(): void 36 { 37 foreach (self::GetModels() as $Model) 38 { 39 $this->InstallModel($Model::GetDesc()); 40 } 41 } 42 43 function DoUnInstall(): void 44 { 45 foreach (array_reverse(self::GetModels()) as $Model) 46 { 47 $this->UninstallModel($Model::GetDesc()); 48 } 32 return array(NewsCategory::GetClassName(), News::GetClassName()); 49 33 } 50 34 … … 302 286 static function GetDesc(): ModelDesc 303 287 { 304 $Desc = new ModelDesc( 'News');305 $Desc->AddReference('Category', 'NewsCategory', true);288 $Desc = new ModelDesc(self::GetClassName()); 289 $Desc->AddReference('Category', NewsCategory::GetClassName(), true); 306 290 $Desc->AddString('Title'); 307 291 $Desc->AddText('Content'); … … 309 293 $Desc->AddString('Author'); 310 294 $Desc->AddString('Enclosure'); 311 $Desc->AddReference('User', 'User');295 $Desc->AddReference('User', User::GetClassName()); 312 296 $Desc->AddString('IP'); 313 297 $Desc->AddString('Link'); … … 320 304 static function GetDesc(): ModelDesc 321 305 { 322 $Desc = new ModelDesc( 'NewsCategory');306 $Desc = new ModelDesc(self::GetClassName()); 323 307 $Desc->AddString('Caption'); 324 308 $Desc->AddString('RSS');
Note:
See TracChangeset
for help on using the changeset viewer.