1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the ICanBoogie package. |
||
5 | * |
||
6 | * (c) Olivier Laviale <[email protected]> |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace ICanBoogie\ActiveRecord; |
||
13 | |||
14 | use ICanBoogie\ActiveRecord; |
||
15 | use ICanBoogie\ActiveRecord\Config\ConnectionDefinition; |
||
16 | use ICanBoogie\ActiveRecord\Config\ModelDefinition; |
||
17 | |||
18 | final class Config |
||
19 | { |
||
20 | public const DEFAULT_CONNECTION_ID = 'primary'; |
||
21 | |||
22 | /** |
||
23 | * @param array{ |
||
24 | * connections: array<string, ConnectionDefinition>, |
||
25 | * models: array<class-string<ActiveRecord>, ModelDefinition>, |
||
26 | * } $an_array |
||
27 | */ |
||
28 | public static function __set_state(array $an_array): self |
||
29 | { |
||
30 | return new self(...$an_array); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param array<string, ConnectionDefinition> $connections |
||
35 | * Where _key_ is an identifier. |
||
36 | * @param array<class-string<ActiveRecord>, ModelDefinition> $models |
||
0 ignored issues
–
show
Documentation
Bug
introduced
by
Loading history...
|
|||
37 | */ |
||
38 | public function __construct( |
||
39 | public readonly array $connections, |
||
40 | public readonly array $models, |
||
41 | ) { |
||
42 | } |
||
43 | } |
||
44 |