code: public function findAllBySpaceId($spaceId)
      {
          $query = $this->getEntityManager()->createQuery(
              'SELECT c1 FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulContentType c1 '
              . 'WHERE c1.revision = (SELECT MAX(c2.revision) FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulContentType c2 WHERE c2.id = c1.id AND c2.spaceId = :spaceId) '
              . 'AND c1.spaceId = :spaceId'
          )->setParameter('spaceId', $spaceId);
          return new ArrayCollection($query->getResult());
      }
docs: {@inheritdoc}