CoolCMS API

ReservationMapper extends ApiMapper
in package

FinalYes

Front mapper that hydrates Api repository data into entities.

Tags
extends

Table of Contents

Properties

$hydrator  : EntityHydrator
$repository  : ReservationRepository

Methods

__construct()  : mixed
book()  : array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}
Passes the booking call through to {@see ReservationRepository::book()}.
cancelByToken()  : array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}
cancelMy()  : array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}
Cancels the logged-in customer's own reservation.
find()  : T|null
findAll()  : T>, 1: int}
findBy()  : T|null
findMyReservations()  : Reservation>, totalCount: int, slots: array}
Returns the reservations of the logged-in customer.
getEntityClass()  : T>
initalizeEntity()  : Reservation|null

Properties

Methods

book()

Passes the booking call through to {@see ReservationRepository::book()}.

public book(string $date, string $timeFrom, string $timeTo, string $name, string $email, string|null $phone, string|null $note, bool $gdprConsent[, int|null $calendarId = null ][, string|null $subject = null ]) : array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}

The response is not an entity and flows through unchanged; the Result envelope is propagated (see the repository docblock).

$calendarId is the public calendar the visitor picked in the switcher; null makes the server use the company's default calendar. $subject is an optional subject. Both are last in the signature with defaults, so existing positional calls stay valid.

Parameters
$date : string
$timeFrom : string
$timeTo : string
$name : string
$email : string
$phone : string|null
$note : string|null
$gdprConsent : bool
$calendarId : int|null = null
$subject : string|null = null
Return values
array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}

cancelByToken()

public cancelByToken(string $token) : array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}
Parameters
$token : string
Return values
array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}

cancelMy()

Cancels the logged-in customer's own reservation.

public cancelMy(int $id) : array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}

Passes the call through to ReservationRepository::cancelMy(). The Result envelope is propagated unchanged, same contract as cancelByToken().

Parameters
$id : int
Return values
array{success: bool, code: int|null, message: string|null, reservationId: int|null, state: string|null, timeFrom?: string|null, timeTo?: string|null, retryAfter?: int, errorCode?: string|null}

find()

public find(int $pageId[, string|array<string|int, mixed> $includes = [] ][, bool|null $useCache = null ]) : T|null
Parameters
$pageId : int
$includes : string|array<string|int, mixed> = []
$useCache : bool|null = null
Return values
T|null

findAll()

public findAll([array<string|int, mixed>|null $filters = [] ][, array<string|int, mixed>|null $orderBys = null ][, int|null $offset = null ][, int|null $limit = null ][, array<string|int, mixed>|null $columns = null ][, bool $computeTotalCount = false ][, string|array<string|int, mixed> $includes = [] ][, bool|null $useCache = null ]) : T>, 1: int}
Parameters
$filters : array<string|int, mixed>|null = []
$orderBys : array<string|int, mixed>|null = null
$offset : int|null = null
$limit : int|null = null
$columns : array<string|int, mixed>|null = null
$computeTotalCount : bool = false
$includes : string|array<string|int, mixed> = []
$useCache : bool|null = null
Return values
T>, 1: int}

findBy()

public findBy([array<string|int, mixed>|null $filters = [] ][, string|array<string|int, mixed> $includes = [] ][, bool|null $useCache = null ]) : T|null
Parameters
$filters : array<string|int, mixed>|null = []
$includes : string|array<string|int, mixed> = []
$useCache : bool|null = null
Return values
T|null

findMyReservations()

Returns the reservations of the logged-in customer.

public findMyReservations([int|null $offset = null ][, int|null $limit = null ][, bool $computeTotalCount = true ]) : Reservation>, totalCount: int, slots: array}

Bridge to the narrow Api action myList (ReservationPresenter::internalActionMyList()). The response has an extra slots key besides the standard items / totalCount / _references, so the base ApiMapper::findAll() is not used; hydrateAll() is called by hand, as in WorkListMapper::findMyLists().

Parameters
$offset : int|null = null
$limit : int|null = null
$computeTotalCount : bool = true
Return values
Reservation>, totalCount: int, slots: array}
On this page

Search results