AssetRepository
class AssetRepository extends Repository (View source)
A repository for Assets
Properties
protected EntityManagerInterface | $entityManager | Doctrine's Entity Manager. |
|
protected array | $defaultOrderings | ||
protected AssetService | $assetService | ||
protected ReflectionService | $reflectionService |
Methods
Find assets by title or given tags
Find Assets with the given Tag assigned
Counts Assets with the given Tag assigned
No description
No description
Adds conditions filtering any implementation of AssetVariantInterface
Returns a DQL clause filtering any implementation of AssetVariantInterface
No description
Iterate over an IterableResult and return a Generator
Find all objects and return an IterableResult
Remove an asset while first validating if the object can be removed or if removal is blocked because the asset is still in use.
Remove the asset even if it is still in use. Use with care, it is probably better to first make sure the asset is not used anymore and then use the remove() method for removal.
Details
QueryResultInterface
findBySearchTermOrTags(string $searchTerm, array $tags = [], AssetCollection $assetCollection = null)
Find assets by title or given tags
QueryResultInterface
findByTag(Tag $tag, AssetCollection $assetCollection = null)
Find Assets with the given Tag assigned
int
countByTag(Tag $tag, AssetCollection $assetCollection = null)
Counts Assets with the given Tag assigned
QueryResultInterface
findAll(AssetCollection $assetCollection = null)
No description
int
countAll()
No description
QueryResultInterface
findUntagged(AssetCollection $assetCollection = null)
Find Assets without any tag
int
countUntagged(AssetCollection $assetCollection = null)
Counts Assets without any tag
QueryResultInterface
findByAssetCollection(AssetCollection $assetCollection)
No description
int
countByAssetCollection(AssetCollection $assetCollection)
Count assets by asset collection
protected void
addAssetCollectionToQueryConstraints(QueryInterface $query, AssetCollection $assetCollection = null)
No description
protected void
addAssetVariantFilterClause(Query $query)
Adds conditions filtering any implementation of AssetVariantInterface
protected string
getAssetVariantFilterClauseForDql(string $alias)
Returns a DQL clause filtering any implementation of AssetVariantInterface
AssetInterface|null
findOneByResourceSha1(string $sha1)
No description
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.
IterableResult
findAllIterator()
Find all objects and return an IterableResult
void
remove(AssetInterface $object)
Remove an asset while first validating if the object can be removed or if removal is blocked because the asset is still in use.
void
removeWithoutUsageChecks(AssetInterface $object)
Remove the asset even if it is still in use. Use with care, it is probably better to first make sure the asset is not used anymore and then use the remove() method for removal.
add(AssetInterface $object)
No description
update(AssetInterface $object)
No description