class UserRegistered

Simple DTO (Data Transfer Object) class for queueing new account E-mail event.

Properties

User $user

User associated with event.

bool $shouldSendEmail

Flag to control if an email should be sent.

Methods

__construct(User $user, bool $shouldSendEmail = false)

Constructor

array
toPayload()

Adds instance variables to payload.

static UserRegistered
fromPayload(array $data)

Retrieves information from payload array and returns new instance of this class.

Details

at line 32
__construct(User $user, bool $shouldSendEmail = false)

Constructor

Parameters

User $user

User associated with event.

bool $shouldSendEmail

Flag to determine if E-mail should be sent. Set default value to false.

at line 43
array toPayload()

Adds instance variables to payload.

Return Value

array

An associative array containing values of instance variables.

at line 57
static UserRegistered fromPayload(array $data)

Retrieves information from payload array and returns new instance of this class.

Parameters

array $data

The payload array.

Return Value

UserRegistered

New instance of this class.