PHP Class Neos\Media\Domain\Repository\AssetRepository

Inheritance: extends Neos\Flow\Persistence\Repository
Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$assetService Neos\Media\Domain\Service\AssetService
$defaultOrderings array
$entityManager Doctrine\Common\Persistence\ObjectManager ..

Public Methods

Method Description
add ( Neos\Media\Domain\Model\AssetInterface $object )
countAll ( ) : integer
countByAssetCollection ( AssetCollection $assetCollection ) : integer Count assets by asset collection
countByTag ( Tag $tag, AssetCollection $assetCollection = null ) : integer Counts Assets with the given Tag assigned
countUntagged ( AssetCollection $assetCollection = null ) : integer Counts Assets without any tag
findAll ( AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface
findAllIterator ( ) : Doctrine\ORM\Internal\Hydration\IterableResult Find all objects and return an IterableResult
findByAssetCollection ( AssetCollection $assetCollection ) : Neos\Flow\Persistence\QueryResultInterface
findBySearchTermOrTags ( string $searchTerm, array $tags = [], AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface Find assets by title or given tags
findByTag ( Tag $tag, AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface Find Assets with the given Tag assigned
findOneByResourceSha1 ( string $sha1 ) : Neos\Media\Domain\Model\AssetInterface | null
findUntagged ( AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface Find Assets without any tag
iterate ( Doctrine\ORM\Internal\Hydration\IterableResult $iterator, callable $callback = null ) : Generator Iterate over an IterableResult and return a Generator
remove ( Neos\Media\Domain\Model\AssetInterface $object ) : void Remove an asset while first validating if the object can be removed or if removal is blocked because the asset is still in use.
removeWithoutUsageChecks ( Neos\Media\Domain\Model\AssetInterface $object ) : void 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.
update ( Neos\Media\Domain\Model\AssetInterface $object )

Protected Methods

Method Description
addAssetCollectionToQueryConstraints ( Query $query, AssetCollection $assetCollection = null ) : void
addImageVariantFilterClause ( Query $query ) : Neos\Flow\Persistence\QueryInterface

Method Details

add() public method

public add ( Neos\Media\Domain\Model\AssetInterface $object )
$object Neos\Media\Domain\Model\AssetInterface

addAssetCollectionToQueryConstraints() protected method

protected addAssetCollectionToQueryConstraints ( Query $query, AssetCollection $assetCollection = null ) : void
$query Neos\Flow\Persistence\Doctrine\Query
$assetCollection Neos\Media\Domain\Model\AssetCollection
return void

addImageVariantFilterClause() protected method

protected addImageVariantFilterClause ( Query $query ) : Neos\Flow\Persistence\QueryInterface
$query Neos\Flow\Persistence\Doctrine\Query
return Neos\Flow\Persistence\QueryInterface

countAll() public method

public countAll ( ) : integer
return integer

countByAssetCollection() public method

Count assets by asset collection
public countByAssetCollection ( AssetCollection $assetCollection ) : integer
$assetCollection Neos\Media\Domain\Model\AssetCollection
return integer

countByTag() public method

Counts Assets with the given Tag assigned
public countByTag ( Tag $tag, AssetCollection $assetCollection = null ) : integer
$tag Neos\Media\Domain\Model\Tag
$assetCollection Neos\Media\Domain\Model\AssetCollection
return integer

countUntagged() public method

Counts Assets without any tag
public countUntagged ( AssetCollection $assetCollection = null ) : integer
$assetCollection Neos\Media\Domain\Model\AssetCollection
return integer

findAll() public method

public findAll ( AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface
$assetCollection Neos\Media\Domain\Model\AssetCollection
return Neos\Flow\Persistence\QueryResultInterface

findAllIterator() public method

Find all objects and return an IterableResult
public findAllIterator ( ) : Doctrine\ORM\Internal\Hydration\IterableResult
return Doctrine\ORM\Internal\Hydration\IterableResult

findByAssetCollection() public method

public findByAssetCollection ( AssetCollection $assetCollection ) : Neos\Flow\Persistence\QueryResultInterface
$assetCollection Neos\Media\Domain\Model\AssetCollection
return Neos\Flow\Persistence\QueryResultInterface

findBySearchTermOrTags() public method

Find assets by title or given tags
public findBySearchTermOrTags ( string $searchTerm, array $tags = [], AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface
$searchTerm string
$tags array
$assetCollection Neos\Media\Domain\Model\AssetCollection
return Neos\Flow\Persistence\QueryResultInterface

findByTag() public method

Find Assets with the given Tag assigned
public findByTag ( Tag $tag, AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface
$tag Neos\Media\Domain\Model\Tag
$assetCollection Neos\Media\Domain\Model\AssetCollection
return Neos\Flow\Persistence\QueryResultInterface

findOneByResourceSha1() public method

public findOneByResourceSha1 ( string $sha1 ) : Neos\Media\Domain\Model\AssetInterface | null
$sha1 string
return Neos\Media\Domain\Model\AssetInterface | null

findUntagged() public method

Find Assets without any tag
public findUntagged ( AssetCollection $assetCollection = null ) : Neos\Flow\Persistence\QueryResultInterface
$assetCollection Neos\Media\Domain\Model\AssetCollection
return Neos\Flow\Persistence\QueryResultInterface

iterate() public method

This method is useful for batch processing huge result set as it clears the object manager and detaches the current object on each iteration.
public iterate ( Doctrine\ORM\Internal\Hydration\IterableResult $iterator, callable $callback = null ) : Generator
$iterator Doctrine\ORM\Internal\Hydration\IterableResult
$callback callable
return Generator

remove() public method

Remove an asset while first validating if the object can be removed or if removal is blocked because the asset is still in use.
public remove ( Neos\Media\Domain\Model\AssetInterface $object ) : void
$object Neos\Media\Domain\Model\AssetInterface
return void

removeWithoutUsageChecks() public method

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.
public removeWithoutUsageChecks ( Neos\Media\Domain\Model\AssetInterface $object ) : void
$object Neos\Media\Domain\Model\AssetInterface
return void

update() public method

public update ( Neos\Media\Domain\Model\AssetInterface $object )
$object Neos\Media\Domain\Model\AssetInterface

Property Details

$assetService protected property

protected AssetService,Neos\Media\Domain\Service $assetService
return Neos\Media\Domain\Service\AssetService

$defaultOrderings protected property

protected array $defaultOrderings
return array

$entityManager protected property

..
protected ObjectManager,Doctrine\Common\Persistence $entityManager
return Doctrine\Common\Persistence\ObjectManager