Booth
in package
FinalYes
Aggregate root representing a booth/expo entry with owners, editors, status, and topics.
Table of Contents
Properties
- $description : string|null
- $editors : array<string|int, WebviepUserId>
- $id : BoothId
- $organizationName : string|null
- $owner : WebviepUserId|null
- $shortDescription : string|null
- $status : BoothStatus
- $title : string
- $topics : array<string|int, string>
Methods
- __construct() : mixed
- Booth constructor.
- archive() : void
- Archive the booth (irreversible).
- assertEditable() : void
- Ensure the booth can be edited by the given user.
- changeStatus() : void
- Change lifecycle phase with a simple invariant.
- description() : string|null
- Detailed description.
- editors() : array<string|int, WebviepUserId>
- Users allowed to edit this booth.
- id() : BoothId
- Identifier of the booth.
- organizationName() : string|null
- Organization name associated with the booth.
- owner() : WebviepUserId|null
- Owning user, if any.
- publish() : void
- Publish the booth when the actor is allowed to do so.
- rename() : void
- Rename with guard to avoid persisting empty titles.
- shortDescription() : string|null
- Short description/teaser.
- status() : BoothStatus
- Current lifecycle status.
- title() : string
- Title of the booth.
- topics() : array<string|int, string>
- Assigned taxonomy topics.
- isEditor() : bool
- Check whether the given user is an editor.
Properties
$description
private
string|null
$description
$editors
private
array<string|int, WebviepUserId>
$editors
$id
private
BoothId
$id
$organizationName
private
string|null
$organizationName
$owner
private
WebviepUserId|null
$owner
$shortDescription
private
string|null
$shortDescription
$status
private
BoothStatus
$status
$title
private
string
$title
$topics
private
array<string|int, string>
$topics
Taxonomy slugs (e.g. topics)
Methods
__construct()
Booth constructor.
public
__construct(BoothId $id, string $title[, string|null $description = null ][, string|null $shortDescription = null ][, string|null $organizationName = null ][, BoothStatus|null $status = null ][, array<string|int, string> $topics = [] ][, WebviepUserId|null $owner = null ][, array<string|int, WebviepUserId> $editors = [] ]) : mixed
Parameters
- $id : BoothId
- $title : string
- $description : string|null = null
- $shortDescription : string|null = null
- $organizationName : string|null = null
- $status : BoothStatus|null = null
- $topics : array<string|int, string> = []
- $owner : WebviepUserId|null = null
- $editors : array<string|int, WebviepUserId> = []
archive()
Archive the booth (irreversible).
public
archive(WebviepUserId $actor) : void
Parameters
- $actor : WebviepUserId
assertEditable()
Ensure the booth can be edited by the given user.
public
assertEditable(WebviepUserId $actor) : void
Parameters
- $actor : WebviepUserId
changeStatus()
Change lifecycle phase with a simple invariant.
public
changeStatus(BoothStatus $newStatus) : void
Parameters
- $newStatus : BoothStatus
description()
Detailed description.
public
description() : string|null
Return values
string|nulleditors()
Users allowed to edit this booth.
public
editors() : array<string|int, WebviepUserId>
Return values
array<string|int, WebviepUserId>id()
Identifier of the booth.
public
id() : BoothId
Return values
BoothIdorganizationName()
Organization name associated with the booth.
public
organizationName() : string|null
Return values
string|nullowner()
Owning user, if any.
public
owner() : WebviepUserId|null
Return values
WebviepUserId|nullpublish()
Publish the booth when the actor is allowed to do so.
public
publish(WebviepUserId $actor) : void
Parameters
- $actor : WebviepUserId
rename()
Rename with guard to avoid persisting empty titles.
public
rename(string $newTitle) : void
Parameters
- $newTitle : string
shortDescription()
Short description/teaser.
public
shortDescription() : string|null
Return values
string|nullstatus()
Current lifecycle status.
public
status() : BoothStatus
Return values
BoothStatustitle()
Title of the booth.
public
title() : string
Return values
stringtopics()
Assigned taxonomy topics.
public
topics() : array<string|int, string>
Return values
array<string|int, string>isEditor()
Check whether the given user is an editor.
private
isEditor(WebviepUserId $userId) : bool
Parameters
- $userId : WebviepUserId