class CreateNotificationJob extends Job

Creates Notifications and schedules sending jobs for each channel

Traits

Properties

protected callable $statusUpdateCallback

Callback tor status updates

from  Job
array $_constructArgs

todo private, then reflection in create

from  Job
protected NotificationMessage $notificationMessage
protected array|null $recipientIds

Methods

__construct(NotificationMessage $notificationMessage, array $recipientIds = null)

CreateNotificationJob constructor.

static self
create(NotificationMessage $notificationMessage, array $recipientIds = null)

No description

bool
execute(QueueableJob $queueableJob = null)

No description

bool
executeInJobQueue(QueueableJob $queueableJob)

When execute is called from Queue an additional QueueableJob Object is passed to execute

from  Job
static JobStatus|null
getStatus(string $uniqueId)

Get the status of your job

from  Job
array
jsonSerialize()

No description

void
onAbort()

Note: This event always is being triggered by the job runner

from  Job
void
onCancel()

Note: This event always is being triggered by the job runner

from  Job
void
onFinish()

Note: This event always is being triggered by the job runner

from  Job
void
onRetry()

Note: This event always is being triggered by the job runner

from  Job
void
onScheduled()

Note: This event may happen in the Frontend call

from  Job
void
onSerialize()

Optional: Called before serialization (e.g. to remember/convert an unserializable prop)

void
onUnserialize()

Optional: Called after unserialize (e.g. load from db / recover or connect resource)

array|null
serializePropertiesInclude()

Optional: Override this method and specify the properties to include during serialize null = All Properties will be serialized (default) [] = No Properties will be serialized ['id'] = $this->id will be serialized

setStatusUpdateCallback(callable $callback)

Sets the callback which should be called if the job needs to update its status As the QueueableJob has no context of the job itself this function is only available from within the execution context (daemon)

from  Job
static object
unserializeObject(SerializedObjectHelper $SerializedObjectHelper)

No description

static object
unserializeObjectFromJSON(string $json)

No description

updateStatusMessage(string $messageToken, int|null $progress = null)

Updates the status message for this job which is being shown in user output (can only be used in execute() function)

from  Job
bool
validate()

If the return is false, the job will not be executed.

from  Job

Details

at line 36
protected __construct(NotificationMessage $notificationMessage, array $recipientIds = null)

CreateNotificationJob constructor.

Parameters

NotificationMessage $notificationMessage
array $recipientIds

at line 24
static self create(NotificationMessage $notificationMessage, array $recipientIds = null)

No description

Parameters

NotificationMessage $notificationMessage
array $recipientIds

Return Value

self

at line 45
bool execute(QueueableJob $queueableJob = null)

No description

Parameters

QueueableJob $queueableJob

Return Value

bool

True indicates a successful run of your job | false will lead to abort or retry when used as QueueableJob

in Job at line 79
bool executeInJobQueue(QueueableJob $queueableJob)

When execute is called from Queue an additional QueueableJob Object is passed to execute

Parameters

QueueableJob $queueableJob

Return Value

bool

in Job at line 162
static JobStatus|null getStatus(string $uniqueId)

Get the status of your job

Parameters

string $uniqueId

Return Value

JobStatus|null

array jsonSerialize()

No description

Return Value

array

Exceptions

ReflectionException

in Job at line 144
void onAbort()

Note: This event always is being triggered by the job runner

Return Value

void

in Job at line 151
void onCancel()

Note: This event always is being triggered by the job runner

Return Value

void

in Job at line 130
void onFinish()

Note: This event always is being triggered by the job runner

Return Value

void

in Job at line 137
void onRetry()

Note: This event always is being triggered by the job runner

Return Value

void

in Job at line 123
void onScheduled()

Note: This event may happen in the Frontend call

Return Value

void

void onSerialize()

Optional: Called before serialization (e.g. to remember/convert an unserializable prop)

Return Value

void

void onUnserialize()

Optional: Called after unserialize (e.g. load from db / recover or connect resource)

Return Value

void

SerializedObjectHelper serializeObject()

No description

protected array|null serializePropertiesInclude()

Optional: Override this method and specify the properties to include during serialize null = All Properties will be serialized (default) [] = No Properties will be serialized ['id'] = $this->id will be serialized

Return Value

array|null

in Job at line 104
setStatusUpdateCallback(callable $callback)

Sets the callback which should be called if the job needs to update its status As the QueueableJob has no context of the job itself this function is only available from within the execution context (daemon)

Parameters

callable $callback

static object unserializeObject(SerializedObjectHelper $SerializedObjectHelper)

No description

Parameters

SerializedObjectHelper $SerializedObjectHelper

Return Value

object

Exceptions

ReflectionException

static object unserializeObjectFromJSON(string $json)

No description

Parameters

string $json

Return Value

object

Exceptions

JsonException
ReflectionException

in Job at line 89
protected updateStatusMessage(string $messageToken, int|null $progress = null)

Updates the status message for this job which is being shown in user output (can only be used in execute() function)

Parameters

string $messageToken
int|null $progress

If given will indicate the progress of this job, should be 0-100

in Job at line 113
bool validate()

If the return is false, the job will not be executed.

Return Value

bool