Neos.Media/Classes/Domain/Repository/ThumbnailRepository.php
public function findOneByAssetAndThumbnailConfiguration(AssetInterface $asset, ThumbnailConfiguration $configuration)
    {
        /**
         * @var $query \Doctrine\ORM\Query
         */
        $query = $this->entityManager->createQuery('SELECT t FROM Neos\Media\Domain\Model\Thumbnail t WHERE t.originalAsset = :originalAsset AND t.configurationHash = :configurationHash');
        $query->setParameter('originalAsset', $this->persistenceManager->getIdentifierByObject($asset));
        $query->setParameter('configurationHash', $configuration->getHash());

        $query->setMaxResults(1);
        $result = $query->getOneOrNullResult();

        return $result;
    }
public function findOneByAssetAndThumbnailConfiguration(AssetInterface $asset, ThumbnailConfiguration $configuration)
    {
        /**
         * @var $query \Doctrine\ORM\Query
         */
        $query = $this->entityManager->createQuery('SELECT t FROM Neos\Media\Domain\Model\Thumbnail t WHERE t.originalAsset = :originalAsset AND t.configurationHash = :configurationHash');
        $query->setParameter('originalAsset', $this->persistenceManager->getIdentifierByObject($asset));
        $query->setParameter('configurationHash', $configuration->getHash());

        $query->setMaxResults(1);
        $result = $query->getOneOrNullResult();

        return $result;
    }
public function findOneByAssetAndThumbnailConfiguration ( AssetInterface $ asset , ThumbnailConfiguration $ configuration ) { /**
         * @var $query \Doctrine\ORM\Query
         */ $ query = $ this -> entityManager -> createQuery ( 'SELECT t FROM Neos\Media\Domain\Model\Thumbnail t WHERE t.originalAsset = :originalAsset AND t.configurationHash = :configurationHash' ) ; $ query -> setParameter ( 'originalAsset' , $ this -> persistenceManager -> getIdentifierByObject ( $ asset ) ) ; $ query -> setParameter ( 'configurationHash' , $ configuration -> getHash ( ) ) ; $ query -> setMaxResults ( 1 ) ; $ result = $ query -> getOneOrNullResult ( ) ; return $ result ; }
Returns a thumbnail of the given asset with the specified dimensions.

@param AssetInterface $asset The asset to render a thumbnail for
@param ThumbnailConfiguration $configuration
@return \Neos\Media\Domain\Model\Thumbnail The thumbnail or NULL
Returns a thumbnail of the given asset with the specified dimensions .