CoolCMS API

RegisterEventTrait

Increments an event counter (views, clicks, …) on an entity, with hooks.

Like SaveTrait, it calls the optional beforeRegisterEvent() and afterRegisterEvent() around the increment; a concrete manager may define them (for example AdvertManager writes daily view statistics in afterRegisterEvent()).

Tags
see
SaveTrait

provides updateColumn(), which this trait relies on.

Table of Contents

Methods

registerEvent()  : Result

Methods

registerEvent()

public registerEvent(array<string|int, int> $ids, class-string $entityClass, string $property) : Result
Parameters
$ids : array<string|int, int>
$entityClass : class-string

entity used to translate the property into a column in the expression

$property : string
Return values
Result
On this page

Search results