ReservationMapper
extends ApiMapper
in package
FinalYes
Admin mapper that hydrates Api repository data into entities.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- bookByAdmin() : Result
- Thin pass-through to the repository (time slot edit modal, filling a reservation).
- cancel() : Result
- confirm() : Result
- Thin pass-through to the repository; the `Result` is already built there (no entity to hydrate).
- delete() : Result
- deleteAll() : Result
- find() : T|null
- findAll() : T>, 1: int}
- findBy() : T|null
- mergeSlots() : Result
- Thin pass-through to the repository (day timeline, merge button).
- save() : Result
- updateByAdmin() : Result
- Thin pass-through to the repository (time slot edit modal, saving a reservation).
- updateColumns() : Result
- getEntityClass() : T>
- initalizeEntity() : Reservation|null
Properties
$hydrator read-only
protected
EntityHydrator
$hydrator
$repository read-only
protected
ReservationRepository
$repository
Methods
__construct()
public
__construct(ReservationRepository $repository, EntityHydrator $hydrator) : mixed
Parameters
- $repository : ReservationRepository
- $hydrator : EntityHydrator
bookByAdmin()
Thin pass-through to the repository (time slot edit modal, filling a reservation).
public
bookByAdmin(int $calendarId, string $date, string $timeFrom, string $timeTo, string $name, string $email, string|null $phone, string|null $note, string $state, bool $notifyClient) : Result
Parameters
- $calendarId : int
- $date : string
- $timeFrom : string
- $timeTo : string
- $name : string
- $email : string
- $phone : string|null
- $note : string|null
- $state : string
- $notifyClient : bool
Return values
Resultcancel()
public
cancel(int $id) : Result
Parameters
- $id : int
Return values
Resultconfirm()
Thin pass-through to the repository; the `Result` is already built there (no entity to hydrate).
public
confirm(int $id) : Result
Parameters
- $id : int
Return values
Resultdelete()
public
delete(int|array<string|int, mixed> $id) : Result
Parameters
- $id : int|array<string|int, mixed>
Return values
ResultdeleteAll()
public
deleteAll([array<string|int, mixed> $filters = [] ]) : Result
Parameters
- $filters : array<string|int, mixed> = []
Return values
Resultfind()
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|nullfindAll()
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|nullmergeSlots()
Thin pass-through to the repository (day timeline, merge button).
public
mergeSlots(int $calendarId, string $date, string $timeFrom, string $timeTo) : Result
Parameters
- $calendarId : int
- $date : string
- $timeFrom : string
- $timeTo : string
Return values
Resultsave()
public
save(BaseEntity $entity[, array<string, mixed> $meta = [] ][, array<int, string> $skipFields = [] ]) : Result
Parameters
- $entity : BaseEntity
- $meta : array<string, mixed> = []
- $skipFields : array<int, string> = []
Return values
ResultupdateByAdmin()
Thin pass-through to the repository (time slot edit modal, saving a reservation).
public
updateByAdmin(int $id, string $name, string $email, string|null $phone, string|null $note, string $state) : Result
Parameters
- $id : int
- $name : string
- $email : string
- $phone : string|null
- $note : string|null
- $state : string
Return values
ResultupdateColumns()
public
updateColumns(array<string|int, mixed> $ids, array<string, mixed> $values) : Result
Parameters
- $ids : array<string|int, mixed>
-
ids or composite-id arrays
- $values : array<string, mixed>
-
property name => new value
Return values
ResultgetEntityClass()
protected
getEntityClass() : T>
Return values
T>initalizeEntity()
protected
initalizeEntity(array<string, mixed> $row) : Reservation|null
Parameters
- $row : array<string, mixed>