packages/ztd-query-core/src/Shadow/Row/RowChange.php

1<?php
2
3declare(strict_types=1);
4
5namespace ZtdQuery\Shadow\Row;
6
7use ZtdQuery\Schema\TableDefinition;
8
9/**
10 * One row as it was, and as it became.
11 *
12 * A cascade has to know both: which row to look for on the child side is
13 * decided by the old values, and what to write there by the new ones.
14 *
15 * @phpstan-import-type Row from TableDefinition
16 */
17final class RowChange
18{
19    /**
20     * @param Row $before The row as it was
21     * @param Row $after The row as it became
22     */
23    public function __construct(
24        public readonly array $before,
25        public readonly array $after,
26    ) {
27    }
28}
29