Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
1 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
RecordReadEvent
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Core\Engine\Domain\Event;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11use App\Core\Engine\Domain\Model\PermissionContext;
12
13/**
14 * Record Read Domain Event.
15 *
16 * Dispatched via Yii3 EventDispatcher (PSR-14) after a successful
17 * read or list operation when audit read logging is enabled.
18 * Consumed by AuditReadListener.
19 *
20 * @package App\Core\Engine\Domain\Event
21 */
22final readonly class RecordReadEvent
23{
24    /**
25     * RecordReadEvent constructor.
26     *
27     * @param string               $moduleName Module name where records were read.
28     * @param int|null             $recordId   Single record ID or null for list read.
29     * @param array<string, mixed>|null $filters Active filters snapshot for list reads.
30     * @param PermissionContext     $context    Security context of the actor.
31     */
32    public function __construct(
33        public readonly string            $moduleName,
34        public readonly ?int              $recordId,
35        public readonly ?array            $filters,
36        public readonly PermissionContext  $context,
37    ) {
38    }
39}