1 | <?php namespace C4tech\RayEmitter\Domain; |
||
10 | abstract class Repository implements RepositoryInterface |
||
11 | { |
||
12 | /** |
||
13 | * @inheritDoc |
||
14 | */ |
||
15 | 1 | public static function get($identifier) |
|
21 | |||
22 | /** |
||
23 | * @inheritDoc |
||
24 | */ |
||
25 | 4 | public static function handle(CommandInterface $command) |
|
55 | |||
56 | /** |
||
57 | * Create |
||
58 | * |
||
59 | * Generate a new Aggregate with no history. |
||
60 | * @return Aggregate |
||
61 | */ |
||
62 | abstract protected static function create(); |
||
63 | |||
64 | /** |
||
65 | * Find |
||
66 | * |
||
67 | * Restore an existing Aggregate from the recorded events related to it. |
||
68 | * @param void|string $identifier Aggregate root entity identifier. |
||
69 | * @return Aggregate |
||
70 | */ |
||
71 | 6 | protected static function find($identifier = null) |
|
82 | } |
||
83 |
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: