/**
  * Gets a user for to create or update entity
  *
  * @param $id
  *
  * @return User
  * @throws EntityNotFoundException
  */
 private function getUser($id)
 {
     if (!$id) {
         return new User();
     } else {
         $user = $this->repository->find($id);
         if (!$user) {
             throw new EntityNotFoundException();
         }
         return $user;
     }
 }