public function getLastRevision(Text $text)
    {
        $dql = "
            SELECT r FROM Claroline\CoreBundle\Entity\Resource\Revision r
            JOIN r.text t2
            WHERE r.version = (SELECT MAX(r2.version) FROM Claroline\CoreBundle\Entity\Resource\Revision r2
            JOIN r2.text t WHERE t.id = {$text->getId()})
            and t2.id = {$text->getId()}
        ";
        $query = $this->_em->createQuery($dql);

        return $query->getSingleResult();
    }