1 | <?php |
||
8 | class Mapper |
||
9 | { |
||
10 | /** @var Structure */ |
||
11 | private $structure; |
||
12 | |||
13 | /** @var array */ |
||
14 | private $repositories = []; |
||
15 | |||
16 | /** |
||
17 | * @param Structure $structure |
||
18 | */ |
||
19 | 68 | public function __construct(Structure $structure) |
|
23 | |||
24 | /** |
||
25 | * Map classes and scopes by repository |
||
26 | * @param Repository $repository |
||
27 | * @param string|null $activeRowClass |
||
28 | * @param string|null $selectionClass |
||
29 | * @return Mapper |
||
30 | */ |
||
31 | 68 | public function mapRepository(Repository $repository, string $activeRowClass = null, string $selectionClass = null): Mapper |
|
46 | |||
47 | /** |
||
48 | * Map classes only by table name |
||
49 | * @param string $tableName |
||
50 | * @param string|null $activeRowClass |
||
51 | * @param string|null $selectionClass |
||
52 | * @return Mapper |
||
53 | */ |
||
54 | 68 | public function mapTableName(string $tableName, string $activeRowClass = null, string $selectionClass = null): Mapper |
|
66 | |||
67 | /** |
||
68 | * @param string $class |
||
69 | * @return null|Repository |
||
70 | */ |
||
71 | 68 | public function getRepository(string $class): ?Repository |
|
75 | } |
||
76 |
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: