1 | <?php |
||
22 | class EntityIdComposer { |
||
23 | |||
24 | /** |
||
25 | * @var callable[] |
||
26 | */ |
||
27 | private $composers; |
||
28 | |||
29 | /** |
||
30 | * @param callable[] $composers Array mapping entity type identifiers to callables accepting a |
||
31 | * single mixed value, representing the unique part of an entity ID serialization, and |
||
32 | * returning an EntityId object. |
||
33 | * |
||
34 | * @throws InvalidArgumentException |
||
35 | */ |
||
36 | public function __construct( array $composers ) { |
||
45 | |||
46 | /** |
||
47 | * @param string $repositoryName |
||
48 | * @param string $entityType |
||
49 | * @param mixed $uniquePart |
||
50 | * |
||
51 | * @throws InvalidArgumentException when the entity type is not known or the unique part is not |
||
52 | * unique. |
||
53 | * @throws UnexpectedValueException when the configured composer did not return an EntityId |
||
54 | * object. |
||
55 | * @return EntityId |
||
56 | */ |
||
57 | public function composeEntityId( $repositoryName, $entityType, $uniquePart ) { |
||
70 | |||
71 | } |
||
72 |