Comment to 'Developer Question: New Module'
  • Thank you @LeonidS

    Next question. Proper way to add cron tasks into the new module? I can find zero documentation. 👀 (allowing me to do something on UNA cron run).

    Also, how to use 'relations' so I can add items to timeline? No documentation on this 'relations' in config of module.

    Thank you.

    • How to work with the Cron Jobs. First of all, your module should have the record in the sys_cron_jobs table. See the example from the Timeline app

      INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `service_call`) VALUES
      ('bx_timeline_hot', '0 * * * *', 'BxTimelineCronHot', 'modules/boonex/timeline/classes/BxTimelineCronHot.php', '');
      

      In the time field, you may set the proper timing of your Cron, if you fill the class field then your app should have the file with the mentioned class. The Cron class must have the processing method, which will be run during this scheduling.

      Please specify about relations - what do you need to do with that?