1 | <?php |
||
7 | class Mapper |
||
8 | { |
||
9 | /** @var Structure */ |
||
10 | private $structure; |
||
11 | |||
12 | /** @var array */ |
||
13 | private $repositories = []; |
||
14 | |||
15 | /** |
||
16 | * @param Structure $structure |
||
17 | */ |
||
18 | 68 | public function __construct(Structure $structure) |
|
22 | |||
23 | /** |
||
24 | * Map classes and scopes by repository |
||
25 | * @param Repository $repository |
||
26 | * @param string|null $activeRowClass |
||
27 | * @param string|null $selectionClass |
||
28 | * @return Mapper |
||
29 | */ |
||
30 | 68 | public function mapRepository(Repository $repository, string $activeRowClass = null, string $selectionClass = null): Mapper |
|
45 | |||
46 | /** |
||
47 | * Map classes only by table name |
||
48 | * @param string $tableName |
||
49 | * @param string|null $activeRowClass |
||
50 | * @param string|null $selectionClass |
||
51 | * @return Mapper |
||
52 | */ |
||
53 | 68 | public function mapTableName(string $tableName, string $activeRowClass = null, string $selectionClass = null): Mapper |
|
65 | |||
66 | /** |
||
67 | * @param string $class |
||
68 | * @return null|Repository |
||
69 | */ |
||
70 | 68 | public function getRepository(string $class): ?Repository |
|
74 | } |
||
75 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: