processwire / processwire-requests

ProcessWire feature requests.
40 stars 0 forks source link

Make LazyCron timeFuncs public #485

Closed gebeer closed 9 months ago

gebeer commented 1 year ago

Short description of the enhancement

I'd like to use https://github.com/processwire/processwire/blob/6ff498f503db118d5b6c190b35bd937b38b80a77/wire/modules/LazyCron.module#L96 array for select options in module configs. Is it possible to change this from protected to public?

BernhardBaumrock commented 1 year ago

That plus a static function that returns the seconds for a given timestring :)

$seconds = LazyCron::seconds('every2Hours'); // 7200
ryancramerdesign commented 9 months ago

@gebeer As a best practice I don't usually make module properties public since one could then modify the value, but I've added a getTimeFuncs method that makes that info available.

@BernhardBaumrock I've added a getTimeFuncSeconds() that will return that info.

gebeer commented 9 months ago

Thank you Ryan.