$count = $this->entityManager->getRepository('AcmeBlogBundle:Article')->createQueryBuilder('a')
->select('COUNT(a)')
->join('a.like_users', 'u')
->where('a.id = :article_id')
->setParameter("article_id", $article_id)
->andWhere('u.id = :user_id')
->setParameter("user_id", $this->getUser()->getId())
->getQuery()
->getSingleScalarResult();