Changeset 894 for trunk/Modules/Task


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

    r893 r894  
    1616  function GetModels(): array
    1717  {
    18     return array('TaskGroup', 'Task', 'Work');
     18    return array(TaskGroup::GetClassName(), Task::GetClassName(), Work::GetClassName());
    1919  }
    2020
     
    111111  static function GetDesc(): ModelDesc
    112112  {
    113     $Desc = new ModelDesc('Task');
     113    $Desc = new ModelDesc(self::GetClassName());
    114114    $Desc->AddString('Name');
    115115    $Desc->AddDate('TimeCreate');
     
    119119    $Desc->AddBoolean('Public');
    120120    $Desc->AddInteger('Progress');
    121     $Desc->AddReference('Group', 'TaskGroup');
     121    $Desc->AddReference('Group', TaskGroup::GetClassName());
    122122    $Desc->AddString('Description');
    123123    $Desc->AddText('Conclusion');
    124     $Desc->AddReference('AssignedTo', 'User');
     124    $Desc->AddReference('AssignedTo', User::GetClassName());
    125125    return $Desc;
    126126  }
     
    131131  static function GetDesc(): ModelDesc
    132132  {
    133     $Desc = new ModelDesc('TaskGroup');
     133    $Desc = new ModelDesc(self::GetClassName());
    134134    $Desc->AddString('Name');
    135135    $Desc->AddText('Description');
    136     $Desc->AddReference('Parent', 'TaskGroup');
     136    $Desc->AddReference('Parent', TaskGroup::GetClassName());
    137137    return $Desc;
    138138  }
     
    143143  static function GetDesc(): ModelDesc
    144144  {
    145     $Desc = new ModelDesc('Work');
     145    $Desc = new ModelDesc(self::GetClassName());
    146146    $Desc->AddString('Name');
    147147    $Desc->AddText('Description');
    148148    $Desc->AddDateTime('TimeStart');
    149149    $Desc->AddFloat('Duration');
    150     $Desc->AddReference('User', 'User');
    151     $Desc->AddReference('Task', 'Task');
     150    $Desc->AddReference('User', User::GetClassName());
     151    $Desc->AddReference('Task', Task::GetClassName());
    152152    return $Desc;
    153153  }
Note: See TracChangeset for help on using the changeset viewer.