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/Stock/Stock.php

    r893 r894  
    1616  function GetModels(): array
    1717  {
    18     return array('Product', 'StockSerialNumber', 'Stock', 'StockMoveGroup', 'StockMove', 'StockMoveItem',
    19       'StockItemHistory', 'StockMoveItemSerialRel');
     18    return array(Product::GetClassName(), StockSerialNumber::GetClassName(), Stock::GetClassName(),
     19      StockMoveGroup::GetClassName(), StockMove::GetClassName(), StockMoveItem::GetClassName(),
     20      StockItemHistory::GetClassName(), StockMoveItemSerialRel::GetClassName());
    2021  }
    2122
     
    267268  static function GetDesc(): ModelDesc
    268269  {
    269     $Desc = new ModelDesc('Product');
    270     $Desc->AddReference('Manufacturer', 'Subject');
     270    $Desc = new ModelDesc(self::GetClassName());
     271    $Desc->AddReference('Manufacturer', Subject::GetClassName());
    271272    $Desc->AddString('Code');
    272273    $Desc->AddString('Name');
     
    275276    $Desc->AddInteger('VAT');
    276277    $Desc->AddInteger('Consumption');
    277     $Desc->AddReference('Supplier', 'Subject');
    278     $Desc->AddReference('UnitOfMeasure', 'UnitOfMeasure');
     278    $Desc->AddReference('Supplier', Subject::GetClassName());
     279    $Desc->AddReference('UnitOfMeasure', UnitOfMeasure::GetClassName());
    279280    $Desc->AddInteger('StockMinCount');
    280281    return $Desc;
     
    286287  static function GetDesc(): ModelDesc
    287288  {
    288     $Desc = new ModelDesc('StockSerialNumber');
    289     $Desc->AddReference('Stock', 'Stock');
    290     $Desc->AddReference('Product', 'Product');
     289    $Desc = new ModelDesc(self::GetClassName());
     290    $Desc->AddReference('Stock', Stock::GetClassName());
     291    $Desc->AddReference('Product', Product::GetClassName());
    291292    $Desc->AddDate('TimeEnlistment');
    292293    $Desc->AddDate('TimeElimination');
     
    296297    $Desc->AddString('SerialNumber');
    297298    $Desc->AddString('RegNumber');
    298     $Desc->AddReference('Location', 'Member');
    299     $Desc->AddReference('Esemble', 'StockSerialNumber');
     299    $Desc->AddReference('Location', Member::GetClassName());
     300    $Desc->AddReference('Esemble', StockSerialNumber::GetClassName());
    300301    return $Desc;
    301302  }
     
    306307  static function GetDesc(): ModelDesc
    307308  {
    308     $Desc = new ModelDesc('Stock');
    309     $Desc->AddReference('Location', 'Member');
     309    $Desc = new ModelDesc(self::GetClassName());
     310    $Desc->AddReference('Location', Member::GetClassName());
    310311    return $Desc;
    311312  }
     
    316317  static function GetDesc(): ModelDesc
    317318  {
    318     $Desc = new ModelDesc('StockMove');
    319     $Desc->AddReference('Group', 'StockMoveGroup');
     319    $Desc = new ModelDesc(self::GetClassName());
     320    $Desc->AddReference('Group', StockMoveGroup::GetClassName());
    320321    $Desc->AddDateTime('Time');
    321     $Desc->AddReference('Stock', 'Stock');
    322     $Desc->AddReference('File', 'File');
     322    $Desc->AddReference('Stock', Stock::GetClassName());
     323    $Desc->AddReference('File', File::GetClassName());
    323324    return $Desc;
    324325  }
     
    329330  static function GetDesc(): ModelDesc
    330331  {
    331     $Desc = new ModelDesc('StockMoveItem');
    332     $Desc->AddReference('StockMove', 'StockMove');
    333     $Desc->AddReference('Product', 'Product');
     332    $Desc = new ModelDesc(self::GetClassName());
     333    $Desc->AddReference('StockMove', StockMove::GetClassName());
     334    $Desc->AddReference('Product', Product::GetClassName());
    334335    $Desc->AddInteger('UnitPrice');
    335336    $Desc->AddInteger('Amount');
     
    342343  static function GetDesc(): ModelDesc
    343344  {
    344     $Desc = new ModelDesc('StockMoveGroup');
     345    $Desc = new ModelDesc(self::GetClassName());
    345346    $Desc->AddString('Name');
    346     $Desc->AddReference('DocumentLine', 'DocumentLine');
     347    $Desc->AddReference('DocumentLine', DocumentLine::GetClassName());
    347348    $Desc->AddInteger('ValueSign');
    348349    $Desc->AddInteger('Direction');
     
    355356  static function GetDesc(): ModelDesc
    356357  {
    357     $Desc = new ModelDesc('StockItemHistory');
     358    $Desc = new ModelDesc(self::GetClassName());
    358359    $Desc->AddDateTime('Time');
    359     $Desc->AddReference('StockSerialNumber', 'StockSerialNumber');
     360    $Desc->AddReference('StockSerialNumber', StockSerialNumber::GetClassName());
    360361    $Desc->AddText('Text');
    361362    return $Desc;
     
    367368  static function GetDesc(): ModelDesc
    368369  {
    369     $Desc = new ModelDesc('StockMoveItemSerialRel');
    370     $Desc->AddReference('StockMoveItem', 'StockMoveItem');
    371     $Desc->AddReference('StockSerialNumber', 'StockSerialNumber');
    372     return $Desc;
    373   }
    374 }
     370    $Desc = new ModelDesc(self::GetClassName());
     371    $Desc->AddReference('StockMoveItem', StockMoveItem::GetClassName());
     372    $Desc->AddReference('StockSerialNumber', StockSerialNumber::GetClassName());
     373    return $Desc;
     374  }
     375}
Note: See TracChangeset for help on using the changeset viewer.