ReservationService
extends ApiService
in package
Admin service that delegates reads to the mapper.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- bookByAdmin() : Result
- Thin pass-through to the mapper.
- cancel() : Result
- confirm() : Result
- delete() : Result
- deleteAll() : Result
- find() : T|null
- Finds one entity by id.
- findAll() : T>, 1: int}
- Finds all entities matching the criteria.
- findBy() : T|null
- Finds one entity by filters.
- getTotalCount() : int|null
- mergeSlots() : Result
- Thin pass-through to the mapper.
- save() : Result
- updateByAdmin() : Result
- Thin pass-through to the mapper.
- updateColumns() : Result
Properties
$mapper read-only
protected
ReservationMapper
$mapper
Methods
__construct()
public
__construct(ReservationMapper $mapper) : mixed
Parameters
- $mapper : ReservationMapper
bookByAdmin()
Thin pass-through to the mapper.
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()
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()
Finds one entity by id.
public
find(int $id[, string|array<string|int, mixed> $includes = [] ][, bool|null $useCache = null ]) : T|null
Parameters
- $id : int
- $includes : string|array<string|int, mixed> = []
- $useCache : bool|null = null
Return values
T|nullfindAll()
Finds all entities matching the criteria.
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()
Finds one entity by filters.
public
findBy([array<string|int, mixed>|null $filters = [] ][, string|array<string|int, mixed>|null $includes = [] ][, bool|null $useCache = null ]) : T|null
Parameters
- $filters : array<string|int, mixed>|null = []
- $includes : string|array<string|int, mixed>|null = []
- $useCache : bool|null = null
Return values
T|nullgetTotalCount()
public
getTotalCount() : int|null
Return values
int|nullmergeSlots()
Thin pass-through to the mapper.
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 mapper.
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