CoolCMS API

EntityNotificationTargetProbe
in package
implements NotificationTargetProbeInterface

AbstractYes

Probe backed by the module's Api entities: notification type key → entity class of the record the type points to. One `id IN (…)` scalar read per type, no hydration.

Runs on the Api side (no bridge, no RBAC), so the cleanup works the same from the administration operation and from the cron job.

Table of Contents

Interfaces

NotificationTargetProbeInterface
Tells whether the records admin notifications point to still exist.

Properties

$em  : EntityManagerInterface

Methods

__construct()  : mixed
existingIds()  : array<int, int>|null
typeKeysForEntity()  : array<int, string>
Notification type keys whose target is this (just deleted) entity — `[]` = none of this probe's types points to it. Called for every ORM delete, so it must stay cheap.
entities()  : array<string, class-string>

Properties

Methods

existingIds()

public existingIds(string $typeKey, array<string|int, mixed> $ids) : array<int, int>|null
Parameters
$typeKey : string
$ids : array<string|int, mixed>

record ids the notifications of this type point to

Return values
array<int, int>|null —

ids that still exist; null = this probe does not own the type

typeKeysForEntity()

Notification type keys whose target is this (just deleted) entity — `[]` = none of this probe's types points to it. Called for every ORM delete, so it must stay cheap.

public typeKeysForEntity(object $entity) : array<int, string>
Parameters
$entity : object
Return values
array<int, string>

entities()

protected abstract entities() : array<string, class-string>
Return values
array<string, class-string> —

notification type key => Api entity class

On this page

Search results