Neos.Media/Classes/Domain/Repository/AssetRepository.php
public function findByTag(Tag $tag, AssetCollection $assetCollection = null)
    {
        $query = $this->createQuery();
        $query->matching($query->contains('tags', $tag));
        $this->addImageVariantFilterClause($query);
        $this->addAssetCollectionToQueryConstraints($query, $assetCollection);
        return $query->execute();
    }
public function findByTag(Tag $tag, AssetCollection $assetCollection = null)
    {
        $query = $this->createQuery();
        $query->matching($query->contains('tags', $tag));
        $this->addImageVariantFilterClause($query);
        $this->addAssetCollectionToQueryConstraints($query, $assetCollection);
        return $query->execute();
    }
public function findByTag ( Tag $ tag , AssetCollection $ assetCollection = null ) { $ query = $ this -> createQuery ( ) ; $ query -> matching ( $ query -> contains ( 'tags' , $ tag ) ) ; $ this -> addImageVariantFilterClause ( $ query ) ; $ this -> addAssetCollectionToQueryConstraints ( $ query , $ assetCollection ) ; return $ query -> execute ( ) ; }
Find Assets with the given Tag assigned

@param Tag $tag
@param AssetCollection $assetCollection
@return QueryResultInterface
@throws InvalidQueryException
Find Assets with the given Tag assigned