public function getById($id, $locale) { $account = $this->accountRepository->findAccountById($id); if (!$account) { throw new EntityNotFoundException($this->accountRepository->getClassName(), $id); } return $this->getApiObject($account, $locale); }