ContactRequest
in package
FinalYes
Aggregate representing a contact request sent to a booth or booth item owner.
Table of Contents
Properties
- $boothId : BoothId
- $boothItemId : BoothItemId|null
- $consentGiven : bool
- $createdAt : DateTimeImmutable
- $fromEmail : string
- $fromName : string
- $id : ContactRequestId
- $message : string
- $senderUserId : WebviepUserId|null
- $status : ContactRequestStatus
Methods
- archive() : void
- Archive the request.
- boothId() : BoothId
- Target booth identifier.
- boothItemId() : BoothItemId|null
- Target booth item identifier (optional).
- consentGiven() : bool
- Whether the sender gave consent (e.g. GDPR).
- createdAt() : DateTimeImmutable
- Creation timestamp.
- createNew() : self
- Factory for new contact requests (sets createdAt/status automatically).
- fromEmail() : string
- Sender email address.
- fromExisting() : self
- Rehydrate an existing contact request.
- fromName() : string
- Sender display name.
- id() : ContactRequestId
- Identifier of the contact request.
- markAsDelivered() : void
- Mark the request as delivered.
- markAsRead() : void
- Mark the request as read.
- message() : string
- Message body.
- senderUserId() : WebviepUserId|null
- Optional sender user id.
- status() : ContactRequestStatus
- Current contact request status.
- __construct() : mixed
- ContactRequest constructor.
Properties
$boothId
private
BoothId
$boothId
$boothItemId
private
BoothItemId|null
$boothItemId
$consentGiven
private
bool
$consentGiven
$createdAt
private
DateTimeImmutable
$createdAt
$fromEmail
private
string
$fromEmail
$fromName
private
string
$fromName
$id
private
ContactRequestId
$id
$message
private
string
$message
$senderUserId
private
WebviepUserId|null
$senderUserId
$status
private
ContactRequestStatus
$status
Methods
archive()
Archive the request.
public
archive() : void
boothId()
Target booth identifier.
public
boothId() : BoothId
Return values
BoothIdboothItemId()
Target booth item identifier (optional).
public
boothItemId() : BoothItemId|null
Return values
BoothItemId|nullconsentGiven()
Whether the sender gave consent (e.g. GDPR).
public
consentGiven() : bool
Return values
boolcreatedAt()
Creation timestamp.
public
createdAt() : DateTimeImmutable
Return values
DateTimeImmutablecreateNew()
Factory for new contact requests (sets createdAt/status automatically).
public
static createNew(ContactRequestId $id, BoothId $boothId, BoothItemId|null $boothItemId, string $fromName, string $fromEmail, string $message, WebviepUserId|null $senderUserId, bool $consentGiven[, DateTimeImmutable|null $createdAt = null ]) : self
Parameters
- $id : ContactRequestId
- $boothId : BoothId
- $boothItemId : BoothItemId|null
- $fromName : string
- $fromEmail : string
- $message : string
- $senderUserId : WebviepUserId|null
- $consentGiven : bool
- $createdAt : DateTimeImmutable|null = null
Return values
selffromEmail()
Sender email address.
public
fromEmail() : string
Return values
stringfromExisting()
Rehydrate an existing contact request.
public
static fromExisting(ContactRequestId $id, BoothId $boothId, BoothItemId|null $boothItemId, string $fromName, string $fromEmail, string $message, WebviepUserId|null $senderUserId, DateTimeImmutable $createdAt, ContactRequestStatus $status, bool $consentGiven) : self
Parameters
- $id : ContactRequestId
- $boothId : BoothId
- $boothItemId : BoothItemId|null
- $fromName : string
- $fromEmail : string
- $message : string
- $senderUserId : WebviepUserId|null
- $createdAt : DateTimeImmutable
- $status : ContactRequestStatus
- $consentGiven : bool
Return values
selffromName()
Sender display name.
public
fromName() : string
Return values
stringid()
Identifier of the contact request.
public
id() : ContactRequestId
Return values
ContactRequestIdmarkAsDelivered()
Mark the request as delivered.
public
markAsDelivered() : void
markAsRead()
Mark the request as read.
public
markAsRead() : void
message()
Message body.
public
message() : string
Return values
stringsenderUserId()
Optional sender user id.
public
senderUserId() : WebviepUserId|null
Return values
WebviepUserId|nullstatus()
Current contact request status.
public
status() : ContactRequestStatus
Return values
ContactRequestStatus__construct()
ContactRequest constructor.
private
__construct(ContactRequestId $id, BoothId $boothId, BoothItemId|null $boothItemId, string $fromName, string $fromEmail, string $message, WebviepUserId|null $senderUserId, DateTimeImmutable $createdAt, ContactRequestStatus $status, bool $consentGiven) : mixed
Parameters
- $id : ContactRequestId
- $boothId : BoothId
- $boothItemId : BoothItemId|null
- $fromName : string
- $fromEmail : string
- $message : string
- $senderUserId : WebviepUserId|null
- $createdAt : DateTimeImmutable
- $status : ContactRequestStatus
- $consentGiven : bool