Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function hydrate(HookInterface $apiService, $entityName) |
||
31 | { |
||
32 | $hydratedEntity = new $entityName(); |
||
33 | |||
34 | if (!$hydratedEntity instanceof HookEventInterface) { |
||
35 | throw new LogicException("Can't hydrate this event"); |
||
36 | } |
||
37 | |||
38 | $hydratedEntity->setEmail($apiService->getEmail()); |
||
39 | $hydratedEntity->setName($apiService->getService()); |
||
40 | $hydratedEntity->setMetaData($apiService->getMetaData()); |
||
41 | |||
42 | $user = $this->userManager->findUserByEmail($apiService->getEmail()); |
||
43 | $hydratedEntity->setUser($user); |
||
44 | |||
45 | return $hydratedEntity; |
||
46 | } |
||
47 | } |
||
48 |