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