public function isProfileAssignedToAnotherUser($curentUserId, $identifier, $provider)
    {
        $qb = $this->createQueryBuilder(null);
        $qb->field('_id')->notEqual($curentUserId)
            ->addAnd(
                $qb->expr()
                    ->addOr($qb->expr()->field('profiles.' . $provider . '.auth.identifier' )->equals($identifier))
                    ->addOr($qb->expr()->field('profile.identifier')->equals($identifier))
            );
        
        return $qb->count()
            ->getQuery()
            ->execute() > 0;
    }