| 1 | <?php |
||
| 13 | class UserPackage implements RegistrationInterface, EntityRegistrationInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @param Container $c |
||
| 17 | */ |
||
| 18 | 26 | public function addToContainer(Container $c): void |
|
| 19 | { |
||
| 20 | $personPackage = new PersonPackage(); |
||
| 21 | $personPackage->addToContainer($c); |
||
| 22 | |||
| 23 | $function = function (Container $c) { |
||
| 24 | 26 | $entityManager = $c->get(EntityManager::class); |
|
| 25 | 26 | $personService = $c->get(PersonService::class); |
|
| 26 | |||
| 27 | 26 | return new UserService($entityManager, $personService); |
|
| 28 | }; |
||
| 29 | |||
| 30 | $c[UserService::class] = $c->factory($function); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | public function getEntityPath(): string |
||
| 40 | } |
||
| 41 |