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

Legend:

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

    r887 r893  
    11<?php
     2
     3class Employee extends Model
     4{
     5  static function GetDesc(): ModelDesc
     6  {
     7    $Desc = new ModelDesc('Employee');
     8    $Desc->AddDateTime('Time');
     9    $Desc->AddString('To');
     10    $Desc->AddString('Subject');
     11    $Desc->AddText('Content');
     12    $Desc->AddString('Headers');
     13    $Desc->AddBoolean('Archive');
     14    $Desc->AddString('From');
     15    $Desc->AddReference('AttachmentFile', 'File');
     16    return $Desc;
     17  }
     18}
     19
     20class EmployeeSalary extends Model
     21{
     22  static function GetDesc(): ModelDesc
     23  {
     24    $Desc = new ModelDesc('EmployeeSalary');
     25    $Desc->AddDate('Date');
     26    $Desc->AddReference('Employee', 'Employee');
     27    $Desc->AddInteger('Amount');
     28    $Desc->AddReference('Contract', 'Contract');
     29    return $Desc;
     30  }
     31}
    232
    333class ModuleEmployee extends AppModule
     
    1141    $this->License = 'GNU/GPL';
    1242    $this->Description = 'Employee wages management';
    13     $this->Dependencies = array('User');
     43    $this->Dependencies = array('User', 'Finance');
     44  }
     45
     46  function GetModels(): array
     47  {
     48    return array('Employee', 'EmployeeSalary');
    1449  }
    1550
Note: See TracChangeset for help on using the changeset viewer.