MessageService
extends ApiService
in package
implements
ServiceInterface
uses
ConfirmByKeyTrait, RedeemManageKeyTrait, SaveTrait, RegisterEventTrait
Front service that reads entities through the mapper.
Tags
Table of Contents
Interfaces
- ServiceInterface
- Contract of the front service layer.
Properties
Methods
- __construct() : mixed
- confirmByKey() : 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
- redeemManageKey() : Result
- registerEvent() : Result
- save() : Result
-
search()
: Message>, 1: int, 2: bool, 3: array
>} |null - Searches messages through the Api endpoint `search` (see {@see MessageMapper::search()}).
- updateColumns() : Result
Properties
$mapper read-only
protected
MessageMapper
$mapper
Methods
__construct()
public
__construct(MessageMapper $mapper) : mixed
Parameters
- $mapper : MessageMapper
confirmByKey()
public
confirmByKey(int $id, string $key) : Result
Parameters
- $id : int
- $key : string
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|nullredeemManageKey()
public
redeemManageKey(int $id, string $key) : Result
Parameters
- $id : int
- $key : string
Return values
ResultregisterEvent()
public
registerEvent(array<string|int, int> $ids, string $property) : Result
Parameters
- $ids : array<string|int, int>
- $property : 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
Resultsearch()
Searches messages through the Api endpoint `search` (see {@see MessageMapper::search()}).
public
search(string $search, string|null $languageAlias[, array<int, object|array<string, mixed>> $filters = [] ][, array<string, mixed>|null $orderBys = null ][, int|null $offset = null ][, int|null $limit = null ][, string|array<int, string> $includes = [] ]) : Message>, 1: int, 2: bool, 3: array>} |null
Parameters
- $search : string
- $languageAlias : string|null
- $filters : array<int, object|array<string, mixed>> = []
- $orderBys : array<string, mixed>|null = null
- $offset : int|null = null
- $limit : int|null = null
- $includes : string|array<int, string> = []
Return values
Message>, 1: int, 2: bool, 3: arrayupdateColumns()
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