| @@ 45-64 (lines=20) @@ | ||
| 42 | * |
|
| 43 | * @return Palladium\Entity\Identity |
|
| 44 | */ |
|
| 45 | public function findIdentityById(int $identityId) |
|
| 46 | { |
|
| 47 | $identity = new Entity\Identity; |
|
| 48 | $identity->setId($identityId); |
|
| 49 | ||
| 50 | $mapper = $this->mapperFactory->create(Mapper\Identity::class); |
|
| 51 | $mapper->fetch($identity); |
|
| 52 | ||
| 53 | if ($identity->getAccountId() === null) { |
|
| 54 | $this->logger->notice('identity not found', [ |
|
| 55 | 'input' => [ |
|
| 56 | 'id' => $identityId, |
|
| 57 | ], |
|
| 58 | ]); |
|
| 59 | ||
| 60 | throw new IdentityNotFound; |
|
| 61 | } |
|
| 62 | ||
| 63 | return $identity; |
|
| 64 | } |
|
| 65 | ||
| 66 | ||
| 67 | /** |
|
| @@ 76-95 (lines=20) @@ | ||
| 73 | * |
|
| 74 | * @return Palladium\Entity\EmailIdentity |
|
| 75 | */ |
|
| 76 | public function findEmailIdentityByEmailAddress(string $emailAddress) |
|
| 77 | { |
|
| 78 | $identity = new Entity\EmailIdentity; |
|
| 79 | $identity->setEmailAddress($emailAddress); |
|
| 80 | ||
| 81 | $mapper = $this->mapperFactory->create(Mapper\EmailIdentity::class); |
|
| 82 | $mapper->fetch($identity); |
|
| 83 | ||
| 84 | if ($identity->getId() === null) { |
|
| 85 | $this->logger->notice('identity not found', [ |
|
| 86 | 'input' => [ |
|
| 87 | 'email' => $emailAddress, |
|
| 88 | ], |
|
| 89 | ]); |
|
| 90 | ||
| 91 | throw new IdentityNotFound; |
|
| 92 | } |
|
| 93 | ||
| 94 | return $identity; |
|
| 95 | } |
|
| 96 | ||
| 97 | ||
| 98 | public function findNonceIdentityByIdentifier(string $identifier) |
|
| @@ 160-179 (lines=20) @@ | ||
| 157 | * |
|
| 158 | * @return Palladium\Entity\EmailIdentity |
|
| 159 | */ |
|
| 160 | public function findEmailIdentityById(int $identityId) |
|
| 161 | { |
|
| 162 | $identity = new Entity\EmailIdentity; |
|
| 163 | $identity->setId($identityId); |
|
| 164 | ||
| 165 | $mapper = $this->mapperFactory->create(Mapper\EmailIdentity::class); |
|
| 166 | $mapper->fetch($identity); |
|
| 167 | ||
| 168 | if ($identity->getAccountId() === null) { |
|
| 169 | $this->logger->notice('identity not found', [ |
|
| 170 | 'input' => [ |
|
| 171 | 'id' => $identityId, |
|
| 172 | ], |
|
| 173 | ]); |
|
| 174 | ||
| 175 | throw new IdentityNotFound; |
|
| 176 | } |
|
| 177 | ||
| 178 | return $identity; |
|
| 179 | } |
|
| 180 | ||
| 181 | ||
| 182 | /** |
|