Ignore:
Timestamp:
Jan 4, 2021, 9:55:40 PM (4 years ago)
Author:
chronos
Message:
  • Modified: More work on modules models initialization.
File:
1 edited

Legend:

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

    r888 r893  
    843843}
    844844
     845class Menu extends Model
     846{
     847  static function GetDesc(): ModelDesc
     848  {
     849    $Desc = new ModelDesc('Menu');
     850    $Desc->AddString('Name');
     851    return $Desc;
     852  }
     853}
     854
     855class MenuItem extends Model
     856{
     857  static function GetDesc(): ModelDesc
     858  {
     859    $Desc = new ModelDesc('MenuItem');
     860    $Desc->AddString('Name');
     861    $Desc->AddReference('Parent', 'MenuItem');
     862    $Desc->AddReference('Action', 'Action');
     863    $Desc->AddReference('Menu', 'Menu');
     864    return $Desc;
     865  }
     866}
     867
     868class MenuItemFavorite extends Model
     869{
     870  static function GetDesc(): ModelDesc
     871  {
     872    $Desc = new ModelDesc('MenuItemFavorite');
     873    $Desc->AddReference('User', 'User');
     874    $Desc->AddReference('MenuItem', 'MenuItem');
     875    return $Desc;
     876  }
     877}
     878
    845879class ModuleIS extends AppModule
    846880{
     
    861895  }
    862896
    863   function DoInstall(): void
    864   {
    865   }
    866 
    867   function DoUninstall(): void
    868   {
     897  function GetModels(): array
     898  {
     899    return array('Menu', 'MenuItem', 'MenuItemFavorite');
    869900  }
    870901
     
    915946  }
    916947
    917   function DoStop(): void
    918   {
    919   }
    920 
    921948  function RegisterDashboardItem(string $Name, callable $Callback): void
    922949  {
Note: See TracChangeset for help on using the changeset viewer.