Reservation
extends BaseEntity
in package
implements
OwnerAwareInterface, IdentifiableInterface
uses
IdentifiableTrait
Reservation of a time slot.
Capacity is 1; a double booking is prevented by a functional unique index in the database
(active_flag, deliberately not mapped here). note is user input, so it must be escaped
on output, otherwise it is an XSS hole.
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'reservation'
Table of Contents
Interfaces
- OwnerAwareInterface
- Entity that knows who created it (the owner is the author or sender of the record); the named entry point to the generic base of the conditional RBAC role `owner`.
- IdentifiableInterface
- Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).
Properties
- $cancelToken : string|null
- $deleted : bool
- $email : string
- $gdprConsentDatetime : DateTime|null
- $id : int|null
- $insertDatetime : DateTime
- $insertIp : string|null
- $name : string
- $note : string|null
- $phone : string|null
- $state : ReservationState
- $subject : string|null
- Optional subject of the reservation, filled in by the client in the modal or edited by the manager on the detail (see `ReservationPresenter`). Not translatable: it is one person's text, not website content.
- $timeSlotId : int
- $userId : int|null
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getCancelToken() : string|null
- getDeleted() : bool
- getEmail() : string
- getGdprConsentDatetime() : DateTime|null
- getId() : int|null
- getInsertDatetime() : DateTime
- getInsertIp() : string|null
- getName() : string
- getNote() : string|null
- getOwnerUserId() : int|null
- Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
- getPhone() : string|null
- getState() : ReservationState
- getSubject() : string|null
- getTimeSlotId() : int
- getUserId() : int|null
- isDeleted() : bool
- isPersisted() : bool
- setCancelToken() : $this
- setDeleted() : $this
- setEmail() : $this
- setGdprConsentDatetime() : $this
- setId() : $this
- setInsertDatetime() : $this
- setInsertIp() : $this
- setName() : $this
- setNote() : $this
- setPhone() : $this
- setState() : $this
- setSubject() : $this
- setTimeSlotId() : $this
- setUserId() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$cancelToken
protected
string|null
$cancelToken
= null
Attributes
- #[Column]
- $name: 'cancel_token'
- $type: 'string'
- $length: 64
- $nullable: true
- #[FieldAccess]
- $read: Audience::None
- $insert: Audience::None
- $update: Audience::None
$deleted
protected
bool
$deleted
= false
Attributes
- #[Column]
- $name: 'deleted'
- $type: 'boolean'
protected
string
$email
= ''
Attributes
- #[Column]
- $name: 'email'
- $type: 'string'
- $length: 255
$gdprConsentDatetime
protected
DateTime|null
$gdprConsentDatetime
= null
Attributes
- #[Column]
- $name: 'gdpr_consent_datetime'
- $type: 'datetime'
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'reservation_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$insertIp
protected
string|null
$insertIp
= null
Attributes
- #[Column]
- $name: 'insert_ip'
- $type: 'string'
- $length: 45
- $nullable: true
- #[PersonalData]
- PersonalDataKind::Hidden
$name
protected
string
$name
= ''
Attributes
- #[Column]
- $name: 'name'
- $type: 'string'
- $length: 100
$note
protected
string|null
$note
= null
Attributes
- #[Column]
- $name: 'note'
- $type: 'text'
- $nullable: true
$phone
protected
string|null
$phone
= null
Attributes
- #[Column]
- $name: 'phone'
- $type: 'string'
- $length: 255
- $nullable: true
$state
protected
ReservationState
$state
= ReservationState::Pending
Attributes
- #[Column]
- $name: 'state'
- $type: 'string'
- $length: 16
- $enumType: ReservationState::class
$subject
Optional subject of the reservation, filled in by the client in the modal or edited by the manager on the detail (see `ReservationPresenter`). Not translatable: it is one person's text, not website content.
protected
string|null
$subject
= null
Attributes
- #[Column]
- $name: 'subject'
- $type: 'string'
- $length: 255
- $nullable: true
$timeSlotId
protected
int
$timeSlotId
= 0
Attributes
- #[Column]
- $name: 'time_slot_id'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$userId
protected
int|null
$userId
= null
Attributes
- #[Column]
- $name: 'cms_system_users_user_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, int $timeSlotId = 0 ][, ReservationState $state = ReservationState::Pending ][, int|null $userId = null ][, string $name = '' ][, string $email = '' ][, string|null $phone = null ][, string|null $note = null ][, string|null $subject = null ][, string|null $cancelToken = null ][, DateTime|null $gdprConsentDatetime = null ][, string|null $insertIp = null ][, DateTime $insertDatetime = new DateTime() ][, bool $deleted = false ]) : mixed
Parameters
- $id : int|null = null
- $timeSlotId : int = 0
- $state : ReservationState = ReservationState::Pending
- $userId : int|null = null
- $name : string = ''
- $email : string = ''
- $phone : string|null = null
- $note : string|null = null
- $subject : string|null = null
- $cancelToken : string|null = null
- $gdprConsentDatetime : DateTime|null = null
- $insertIp : string|null = null
- $insertDatetime : DateTime = new DateTime()
- $deleted : bool = false
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getCancelToken()
public
getCancelToken() : string|null
Return values
string|nullgetDeleted()
public
getDeleted() : bool
Return values
boolgetEmail()
public
getEmail() : string
Return values
stringgetGdprConsentDatetime()
public
getGdprConsentDatetime() : DateTime|null
Return values
DateTime|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetInsertIp()
public
getInsertIp() : string|null
Return values
string|nullgetName()
public
getName() : string
Return values
stringgetNote()
public
getNote() : string|null
Return values
string|nullgetOwnerUserId()
Returns the id of the user who created the record; `null` for an unknown or anonymous owner.
public
getOwnerUserId() : int|null
Return values
int|nullgetPhone()
public
getPhone() : string|null
Return values
string|nullgetState()
public
getState() : ReservationState
Return values
ReservationStategetSubject()
public
getSubject() : string|null
Return values
string|nullgetTimeSlotId()
public
getTimeSlotId() : int
Return values
intgetUserId()
public
getUserId() : int|null
Return values
int|nullisDeleted()
public
isDeleted() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolsetCancelToken()
public
setCancelToken(string|null $cancelToken) : $this
Parameters
- $cancelToken : string|null
Return values
$thissetDeleted()
public
setDeleted(bool $deleted) : $this
Parameters
- $deleted : bool
Return values
$thissetEmail()
public
setEmail(string $email) : $this
Parameters
- $email : string
Return values
$thissetGdprConsentDatetime()
public
setGdprConsentDatetime(DateTime|null $gdprConsentDatetime) : $this
Parameters
- $gdprConsentDatetime : DateTime|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetInsertIp()
public
setInsertIp(string|null $insertIp) : $this
Parameters
- $insertIp : string|null
Return values
$thissetName()
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thissetNote()
public
setNote(string|null $note) : $this
Parameters
- $note : string|null
Return values
$thissetPhone()
public
setPhone(string|null $phone) : $this
Parameters
- $phone : string|null
Return values
$thissetState()
public
setState(ReservationState $state) : $this
Parameters
- $state : ReservationState
Return values
$thissetSubject()
public
setSubject(string|null $subject) : $this
Parameters
- $subject : string|null
Return values
$thissetTimeSlotId()
public
setTimeSlotId(int $timeSlotId) : $this
Parameters
- $timeSlotId : int
Return values
$thissetUserId()
public
setUserId(int|null $userId) : $this
Parameters
- $userId : int|null
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>