Changeset 894 for trunk/Modules/Meals


Ignore:
Timestamp:
Jan 5, 2021, 10:30:31 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Further improved models initialization system.
File:
1 edited

Legend:

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

    r888 r894  
    196196  }
    197197
    198   function DoInstall(): void
    199   {
    200   }
    201 
    202   function DoUnInstall(): void
    203   {
     198  function GetModels(): array
     199  {
     200    return array(Meals::GetClassName(), MealsInfo::GetClassName());
    204201  }
    205202
     
    209206  }
    210207}
     208
     209class Meals extends Model
     210{
     211  static function GetDesc(): ModelDesc
     212  {
     213    $Desc = new ModelDesc(self::GetClassName());
     214    $Desc->AddDate('Date');
     215    $Desc->AddString('Soup');
     216    $Desc->AddString('Meal');
     217    $Desc->AddInteger('Status');
     218    return $Desc;
     219  }
     220}
     221
     222class MealsInfo extends Model
     223{
     224  static function GetDesc(): ModelDesc
     225  {
     226    $Desc = new ModelDesc(self::GetClassName());
     227    $Desc->AddText('Info');
     228    $Desc->AddInteger('Price');
     229    return $Desc;
     230  }
     231}
Note: See TracChangeset for help on using the changeset viewer.