1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Cycle\Schema; |
||
6 | |||
7 | use Cycle\Database\Exception\DBALException; |
||
8 | use Cycle\Schema\Exception\SchemaModifierException; |
||
9 | |||
10 | /** |
||
11 | * Carries information about any entity and table declarations. |
||
12 | */ |
||
13 | interface SchemaModifierInterface |
||
14 | { |
||
15 | /** |
||
16 | * @param non-empty-string $role |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
![]() |
|||
17 | */ |
||
18 | public function withRole(string $role): static; |
||
19 | |||
20 | /** |
||
21 | * Compute structure changes (table column names, types etc). Also ensures existence of fields in entities. |
||
22 | * |
||
23 | * @throws SchemaModifierException |
||
24 | */ |
||
25 | public function compute(Registry $registry): void; |
||
26 | |||
27 | /** |
||
28 | * Render needed indexes and foreign keys into table. |
||
29 | * |
||
30 | * @throws SchemaModifierException |
||
31 | * @throws DBALException |
||
32 | */ |
||
33 | public function render(Registry $registry): void; |
||
34 | |||
35 | /** |
||
36 | * Modify Entity schema array |
||
37 | * |
||
38 | * @param array $schema Entity schema |
||
39 | */ |
||
40 | public function modifySchema(array &$schema): void; |
||
41 | } |
||
42 |