Ejemplo n.º 1
0
 /**
  * @param UniqueIdentifierInterface $id
  * @return boolean|User
  */
 public function findById(UniqueIdentifierInterface $id)
 {
     if ($userEntity = $this->userRepository->findOneByUuid($id->toString())) {
         return $this->transformPDOEntityToUser($userEntity);
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }