Skip to content
Corex

NotificationServiceImpl

Corex\Config\Notifications\NotificationServiceImpl · class · Config layer

The WordPress-side boundary modules and UI program against. It resolves “the current actor” from WordPress (get_current_user_id, current_user_can) and delegates storage + visibility to the repository, so producers and controllers stay free of that plumbing. Publishing is dedup-aware (via the repository) and never throws to a producer — a notification failure must not derail the event that caused it.

__construct(NotificationRepository $repository)

Section titled “__construct(NotificationRepository $repository)”

publish(Notification $notification): Notification

Section titled “publish(Notification $notification): Notification”

resolve(string $dedupKey, string $reason): int

Section titled “resolve(string $dedupKey, string $reason): int”

forCurrentActor(NotificationQuery $query): array

Section titled “forCurrentActor(NotificationQuery $query): array”

findForCurrentActor(int $notificationId): ?array

Section titled “findForCurrentActor(int $notificationId): ?array”

markReadForCurrentActor(int $notificationId): bool

Section titled “markReadForCurrentActor(int $notificationId): bool”

markUnreadForCurrentActor(int $notificationId): bool

Section titled “markUnreadForCurrentActor(int $notificationId): bool”

dismissForCurrentActor(int $notificationId): bool

Section titled “dismissForCurrentActor(int $notificationId): bool”

snoozeForCurrentActor(int $notificationId, DateTimeImmutable $until): bool

Section titled “snoozeForCurrentActor(int $notificationId, DateTimeImmutable $until): bool”

resolveById(int $notificationId, string $reason): bool

Section titled “resolveById(int $notificationId, string $reason): bool”