Event
in package
Event Entity - Business object representing an event
This entity encapsulates all event data and business logic following Domain-Driven Design principles. Properties are private to ensure data integrity and encapsulation.
Business Logic:
- isPast(): Check if event has already occurred
- isFull(): Check if event has reached maximum capacity (requires registration data)
- getFormattedDate(): Get human-readable date
Tags
Table of Contents
Properties
- $date : string
- $description : string
- $id : int|null
- $images : string
- $isGroupEvent : bool
- $location : string
- $name : string
- $slug : string
- $statusParticipating : string
- $teamSize : int
- $theme : string
- $time : string
Methods
- __construct() : mixed
- getDate() : string
- getDescription() : string
- getFormattedDate() : string
- Get formatted date for display (French format: dd/mm/YYYY)
- getFormattedTime() : string
- Get formatted time for display (HH:MM format)
- getId() : int|null
- getImages() : string
- getImagesArray() : array<int, mixed>
- Get images as decoded array
- getLocation() : string
- getName() : string
- getSlug() : string
- getStatusParticipating() : string
- getTeamSize() : int
- getTheme() : string
- getTime() : string
- hasImages() : bool
- Check if event has images
- isGroupEvent() : bool
- isPast() : bool
- Check if the event has already occurred
- setDate() : void
- setDescription() : void
- setImages() : void
- setIsGroupEvent() : void
- setLocation() : void
- setName() : void
- setSlug() : void
- setStatusParticipating() : void
- setTeamSize() : void
- setTheme() : void
- setTime() : void
Properties
$date
private
string
$date
$description
private
string
$description
$id
private
int|null
$id
$images
private
string
$images
$isGroupEvent
private
bool
$isGroupEvent
$location
private
string
$location
$name
private
string
$name
$slug
private
string
$slug
$statusParticipating
private
string
$statusParticipating
$teamSize
private
int
$teamSize
$theme
private
string
$theme
$time
private
string
$time
Methods
__construct()
public
__construct(int|null $id, string $name, string $slug, string $date, string $time, string $location, string $theme, string $statusParticipating, string $description, string $images, bool $isGroupEvent, int $teamSize) : mixed
Parameters
- $id : int|null
-
Unique identifier (null for new events)
- $name : string
-
Event name/title
- $slug : string
-
SEO-friendly URL slug
- $date : string
-
Event date (Y-m-d format)
- $time : string
-
Event time (H:i format)
- $location : string
-
Event location/venue
- $theme : string
-
Event theme/category
- $statusParticipating : string
-
Allowed participant statuses (comma-separated)
- $description : string
-
Event description
- $images : string
-
JSON string of Cloudinary image URLs
- $isGroupEvent : bool
-
Whether this is a group event
- $teamSize : int
-
Maximum team size for group events
getDate()
public
getDate() : string
Return values
stringgetDescription()
public
getDescription() : string
Return values
stringgetFormattedDate()
Get formatted date for display (French format: dd/mm/YYYY)
public
getFormattedDate() : string
Return values
string —Formatted date string
getFormattedTime()
Get formatted time for display (HH:MM format)
public
getFormattedTime() : string
Return values
string —Formatted time string
getId()
public
getId() : int|null
Return values
int|nullgetImages()
public
getImages() : string
Return values
stringgetImagesArray()
Get images as decoded array
public
getImagesArray() : array<int, mixed>
Decodes the JSON images string into an array of image URLs.
Return values
array<int, mixed> —Array of image data
getLocation()
public
getLocation() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetSlug()
public
getSlug() : string
Return values
stringgetStatusParticipating()
public
getStatusParticipating() : string
Return values
stringgetTeamSize()
public
getTeamSize() : int
Return values
intgetTheme()
public
getTheme() : string
Return values
stringgetTime()
public
getTime() : string
Return values
stringhasImages()
Check if event has images
public
hasImages() : bool
Return values
bool —True if event has at least one image
isGroupEvent()
public
isGroupEvent() : bool
Return values
boolisPast()
Check if the event has already occurred
public
isPast() : bool
Compares the event date/time with current date/time to determine if the event is in the past.
Return values
bool —True if event is past, false otherwise
setDate()
public
setDate(string $date) : void
Parameters
- $date : string
setDescription()
public
setDescription(string $description) : void
Parameters
- $description : string
setImages()
public
setImages(string $images) : void
Parameters
- $images : string
setIsGroupEvent()
public
setIsGroupEvent(bool $isGroupEvent) : void
Parameters
- $isGroupEvent : bool
setLocation()
public
setLocation(string $location) : void
Parameters
- $location : string
setName()
public
setName(string $name) : void
Parameters
- $name : string
setSlug()
public
setSlug(string $slug) : void
Parameters
- $slug : string
setStatusParticipating()
public
setStatusParticipating(string $statusParticipating) : void
Parameters
- $statusParticipating : string
setTeamSize()
public
setTeamSize(int $teamSize) : void
Parameters
- $teamSize : int
setTheme()
public
setTheme(string $theme) : void
Parameters
- $theme : string
setTime()
public
setTime(string $time) : void
Parameters
- $time : string