class ThumbnailRepository extends Repository (View source)

A repository for Thumbnails

Note that this repository is not part of the public API. Use the asset's getThumbnail() method instead.

Properties

protected EntityManagerInterface $entityManager
protected LoggerInterface $logger

Methods

Generator|null
iterate(IterableResult $iterator, callable $callback = null)

Iterate over an IterableResult and return a Generator

IterableResult
findAllIterator(string $configurationHash = null)

Find all objects and return an IterableResult

IterableResult
findUngeneratedIterator()

Find ungenerated objects and return an IterableResult

int
countUngenerated()

Count ungenerated objects

Thumbnail|null
findOneByAssetAndThumbnailConfiguration(AssetInterface $asset, ThumbnailConfiguration $configuration)

Returns a thumbnail of the given asset with the specified dimensions.

Thumbnail|null
persistThumbnailDirectly(Thumbnail $thumbnail, ThumbnailConfiguration $configuration)

store via DBAL to avoid errors caused by concurrent creation of thumbnails - see https://github.com/neos/neos-development-collection/issues/3479#issuecomment-1016375400

Details

Generator|null iterate(IterableResult $iterator, callable $callback = null)

Iterate over an IterableResult and return a Generator

This method is useful for batch processing huge result set as it clears the object manager and detaches the current object on each iteration.

Parameters

IterableResult $iterator
callable $callback

Return Value

Generator|null

IterableResult findAllIterator(string $configurationHash = null)

Find all objects and return an IterableResult

Parameters

string $configurationHash

Optional filtering by configuration hash (preset)

Return Value

IterableResult

IterableResult findUngeneratedIterator()

Find ungenerated objects and return an IterableResult

Return Value

IterableResult

int countUngenerated()

Count ungenerated objects

Return Value

int

Thumbnail|null findOneByAssetAndThumbnailConfiguration(AssetInterface $asset, ThumbnailConfiguration $configuration)

Returns a thumbnail of the given asset with the specified dimensions.

Parameters

AssetInterface $asset

The asset to render a thumbnail for

ThumbnailConfiguration $configuration

Return Value

Thumbnail|null

The thumbnail or NULL

Exceptions

NonUniqueResultException

Thumbnail|null persistThumbnailDirectly(Thumbnail $thumbnail, ThumbnailConfiguration $configuration)

store via DBAL to avoid errors caused by concurrent creation of thumbnails - see https://github.com/neos/neos-development-collection/issues/3479#issuecomment-1016375400

Parameters

Thumbnail $thumbnail
ThumbnailConfiguration $configuration

Return Value

Thumbnail|null

Exceptions

Exception
Exception
NonUniqueResultException
IllegalObjectTypeException