class UserRegistered

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

Properties

Users $user

User associated with event.

bool $shouldSendEmail

Flag to control if an email should be sent.

Methods

__construct(Users $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 31
__construct(Users $user, bool $shouldSendEmail = false)

Constructor

Parameters

Users $user

User associated with event.

bool $shouldSendEmail

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

at line 42
array toPayload()

Adds instance variables to payload.

Return Value

array

An associative array containing values of instance variables.

at line 56
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.