CoolCMS API

Reservation extends Reservation
in package

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
#[Entity]
#[Table]
$name: 'cms_mod_company_reservations'
#[TableAlias]
'reservation'

Table of Contents

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
#[ExternalReadonly]
#[FieldAccess]
$read: Audience::None
$insert: Audience::None
$update: Audience::None

$email

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
#[ExternalReadonly]

$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'
#[ExternalReadonly]

$insertIp

protected string|null $insertIp = null
Attributes
#[Column]
$name: 'insert_ip'
$type: 'string'
$length: 45
$nullable: true
#[ExternalReadonly]
#[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

$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
#[ExternalReadonly]

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|null

getDeleted()

public getDeleted() : bool
Return values
bool

getEmail()

public getEmail() : string
Return values
string

getGdprConsentDatetime()

public getGdprConsentDatetime() : DateTime|null
Return values
DateTime|null

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getInsertIp()

public getInsertIp() : string|null
Return values
string|null

getName()

public getName() : string
Return values
string

getNote()

public getNote() : string|null
Return values
string|null

getOwnerUserId()

Returns the id of the user who created the record; `null` for an unknown or anonymous owner.

public getOwnerUserId() : int|null
Return values
int|null

getPhone()

public getPhone() : string|null
Return values
string|null

getSubject()

public getSubject() : string|null
Return values
string|null

getTimeSlotId()

public getTimeSlotId() : int
Return values
int

getUserId()

public getUserId() : int|null
Return values
int|null

isDeleted()

public isDeleted() : bool
Return values
bool

setCancelToken()

public setCancelToken(string|null $cancelToken) : $this
Parameters
$cancelToken : string|null
Return values
$this

setDeleted()

public setDeleted(bool $deleted) : $this
Parameters
$deleted : bool
Return values
$this

setEmail()

public setEmail(string $email) : $this
Parameters
$email : string
Return values
$this

setGdprConsentDatetime()

public setGdprConsentDatetime(DateTime|null $gdprConsentDatetime) : $this
Parameters
$gdprConsentDatetime : DateTime|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertDatetime()

public setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
$insertDatetime : DateTime
Return values
$this

setInsertIp()

public setInsertIp(string|null $insertIp) : $this
Parameters
$insertIp : string|null
Return values
$this

setName()

public setName(string $name) : $this
Parameters
$name : string
Return values
$this

setNote()

public setNote(string|null $note) : $this
Parameters
$note : string|null
Return values
$this

setPhone()

public setPhone(string|null $phone) : $this
Parameters
$phone : string|null
Return values
$this

setSubject()

public setSubject(string|null $subject) : $this
Parameters
$subject : string|null
Return values
$this

setTimeSlotId()

public setTimeSlotId(int $timeSlotId) : $this
Parameters
$timeSlotId : int
Return values
$this

setUserId()

public setUserId(int|null $userId) : $this
Parameters
$userId : int|null
Return values
$this

getTraitsRecursive()

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>
Return values
array<string, string>
On this page

Search results