public function findByUser($userOrId)
    {
        $userId = $userOrId instanceof \Auth\Entity\UserInterface ? $userOrId->getId() : $userOrId;
        $qb     = $this->createQueryBuilder();

        /*
         * HiringOrganizations also could be associated to the user, but we
         * do not want them to be queried here, so the query needs to check the
         * "parent" field, too.
         */
//        $qb->addAnd(
//           $qb->expr()->field('user')->equals($userId)
//                      ->addOr(
//                            $qb->expr()->addOr($qb->expr()->field('parent')->exists(false))
//                                       ->addOr($qb->expr()->field('parent')->equals(null))
//           )
//        );
        $qb->addAnd($qb->expr()->field('user')->equals($userId))
           ->addAnd(
               $qb->expr()->addOr($qb->expr()->field('parent')->exists(false))
                               ->addOr($qb->expr()->field('parent')->equals(null))
           );

        $q      = $qb->getQuery();
        $entity = $q->getSingleResult();

        return $entity;
    }