You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I feel that it could be usefull to provide pattern like
class NotifyContestantsJob implements ExecutableJob {
private$templateMails;
publicfunctionvalidateParameters() {
$parameters = func_get_args();
// check if $parameters[0] is array of Person// check if $parameters[1] is a Contest
}
publicfunctiongetJobProperties() {
return [
'transaction-atomic',
];
}
publicfunctionrun(Person[] $contestants, Contests$contest) {
foreach ($contestantsas$contestant) {
$this->templateMails->sendContestMail($contestants, $contest);
}
}
}
This could be used in two ways:
// either directly:
$notifyContestantJob->run($contestants, $contest);
// or with some other context
JobExecutor::schedule($notifyContestantJob, $contestants, $contest);
Also it might be nice to specify bulk/single logic?
The text was updated successfully, but these errors were encountered:
I feel that it could be usefull to provide pattern like
This could be used in two ways:
Also it might be nice to specify bulk/single logic?
The text was updated successfully, but these errors were encountered: