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

    r893 r894  
    1212    $this->Description = 'Allow to setup and execute planned and recurring tasks';
    1313    $this->Dependencies = array();
     14  }
     15
     16  function GetModels(): array
     17  {
     18    return array(SchedulerAction::GetClassName(), Scheduler::GetClassName());
    1419  }
    1520
     
    120125  }
    121126}
     127
     128class Scheduler extends Model
     129{
     130  static function GetDesc(): ModelDesc
     131  {
     132    $Desc = new ModelDesc(self::GetClassName());
     133    $Desc->AddString('Name');
     134    $Desc->AddBoolean('Enabled');
     135    $Desc->AddDateTime('ScheduledTime');
     136    $Desc->AddReference('Action', SchedulerAction::GetClassName());
     137    $Desc->AddInteger('Period');
     138    $Desc->AddDateTime('LastExecutedTime');
     139    $Desc->AddInteger('Duration');
     140    $Desc->AddText('Log');
     141    return $Desc;
     142  }
     143}
     144
     145class SchedulerAction extends Model
     146{
     147  static function GetDesc(): ModelDesc
     148  {
     149    $Desc = new ModelDesc(self::GetClassName());
     150    $Desc->AddString('Name');
     151    $Desc->AddString('Class');
     152    return $Desc;
     153  }
     154}
Note: See TracChangeset for help on using the changeset viewer.