Repository/DoctrineContentfulEntryRepository.php
function findByContentTypeIdAndName($spaceId, $contentTypeId, $name)
    {
        $query = $this->getEntityManager()->createQuery(
            'SELECT e1 FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulEntry e1 '
            . 'WHERE e1.name = :name '
            . 'AND e1.contentTypeId = :contentTypeId '
            . 'AND e1.spaceId = :spaceId '
            . 'AND e1.revision = (SELECT MAX(e2.revision) FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulEntry e2 WHERE e2.id = e1.id AND e2.spaceId = :spaceId)'
        )
            ->setParameter('contentTypeId', $contentTypeId)
            ->setParameter('spaceId', $spaceId)
            ->setParameter('name', $name)
        ;
        return Option::fromValue($query->getOneOrNullResult());
    }
function findByContentTypeIdAndName($spaceId, $contentTypeId, $name)
    {
        $query = $this->getEntityManager()->createQuery(
            'SELECT e1 FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulEntry e1 '
            . 'WHERE e1.name = :name '
            . 'AND e1.contentTypeId = :contentTypeId '
            . 'AND e1.spaceId = :spaceId '
            . 'AND e1.revision = (SELECT MAX(e2.revision) FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulEntry e2 WHERE e2.id = e1.id AND e2.spaceId = :spaceId)'
        )
            ->setParameter('contentTypeId', $contentTypeId)
            ->setParameter('spaceId', $spaceId)
            ->setParameter('name', $name)
        ;
        return Option::fromValue($query->getOneOrNullResult());
    }
function findByContentTypeIdAndName ( $ spaceId , $ contentTypeId , $ name ) { $ query = $ this -> getEntityManager ( ) -> createQuery ( 'SELECT e1 FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulEntry e1 ' . 'WHERE e1.name = :name ' . 'AND e1.contentTypeId = :contentTypeId ' . 'AND e1.spaceId = :spaceId ' . 'AND e1.revision = (SELECT MAX(e2.revision) FROM Dothiv\Bundle\ContentfulBundle\Item\ContentfulEntry e2 WHERE e2.id = e1.id AND e2.spaceId = :spaceId)' ) -> setParameter ( 'contentTypeId' , $ contentTypeId ) -> setParameter ( 'spaceId' , $ spaceId ) -> setParameter ( 'name' , $ name ) ; return Option :: fromValue ( $ query -> getOneOrNullResult ( ) ) ; }
@param string $spaceId
@param string $contentTypeId
@param string $name

@return Option
@param string $spaceId @param string $contentTypeId @param string $name