/** * @param UniqueIdentifierInterface $id * @return boolean|User */ public function findById(UniqueIdentifierInterface $id) { if ($userEntity = $this->userRepository->findOneByUuid($id->toString())) { return $this->transformPDOEntityToUser($userEntity); } return false; }
/** * @param UniqueIdentifierInterface $id * * @return Role|null */ public function findById(UniqueIdentifierInterface $id) { /** @var RoleId $roleId */ $collection = isset($this->roles[$id->toInteger()]) ? $this->roles[$id->toInteger()] : false; if (false !== $collection) { return $this->roleFactory->createRole($id->toInteger(), $collection['label'], $collection['permission']); } return null; }