Scandal
Well-known member
XF:CronEntry entity has the array column run_rules.
Based on these run_rules, I want to characterize a CronEntry as daily, weekly, monthly, yearly or multiple times per day.
For example to make a getter which returns 'daily', 'weekly' and so on.
Could anyone give some ideas?
\XF::dump($this->run_rules) examples:
These cron runs every 1 (!) minute (multiple times per day) :
![1.png 1.png](https://xenforo.com/community/data/attachments/276/276015-e042d7497674b73d21b1fb8e71ad2825.jpg?hash=4ELXSXZ0tz)
These cron runs every 1st December (yearly) :
![2.png 2.png](https://xenforo.com/community/data/attachments/276/276016-bc53be188c93393ef4e762c62cfee8da.jpg?hash=vFO-GIyTOT)
These cron runs every day at 00:00 (daily) :
![3.png 3.png](https://xenforo.com/community/data/attachments/276/276017-1f44eb8b4ca88b2e176ed3b49b8e71be.jpg?hash=H0Tri0yoiy)
and so one.
Those are just some examples, of course I'm looking for a solution which includes any case.
Any idea?![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)
Based on these run_rules, I want to characterize a CronEntry as daily, weekly, monthly, yearly or multiple times per day.
For example to make a getter which returns 'daily', 'weekly' and so on.
Could anyone give some ideas?
\XF::dump($this->run_rules) examples:
These cron runs every 1 (!) minute (multiple times per day) :
![1.png 1.png](https://xenforo.com/community/data/attachments/276/276015-e042d7497674b73d21b1fb8e71ad2825.jpg?hash=4ELXSXZ0tz)
These cron runs every 1st December (yearly) :
![2.png 2.png](https://xenforo.com/community/data/attachments/276/276016-bc53be188c93393ef4e762c62cfee8da.jpg?hash=vFO-GIyTOT)
These cron runs every day at 00:00 (daily) :
![3.png 3.png](https://xenforo.com/community/data/attachments/276/276017-1f44eb8b4ca88b2e176ed3b49b8e71be.jpg?hash=H0Tri0yoiy)
and so one.
Those are just some examples, of course I'm looking for a solution which includes any case.
Any idea?
![Smile :) :)](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f642.png)