ResourceRepository
class ResourceRepository extends Repository (View source)
PersistentResource Repository
Note that this repository is not part of the public API and must not be used in client code. Please use the API provided by ResourceManager instead.
Constants
ENTITY_CLASSNAME |
|
Properties
protected PersistenceManagerInterface | $persistenceManager | ||
protected string | $entityClassName | Warning: if you think you want to set this, look at RepositoryInterface::ENTITY_CLASSNAME first! |
from Repository |
protected array | $defaultOrderings | from Repository | |
protected EntityManagerInterface | $entityManager | ||
protected SplObjectStorage|PersistentResource[] | $removedResources | ||
protected SplObjectStorage|PersistentResource[] | $addedResources |
Methods
Constructor
Returns the classname of the entities this repository is managing.
No description
Removes a PersistentResource object from this repository
Finds an object matching the given identifier.
Removes all objects of this repository as if remove() was called for all of them.
Sets the property names to order results by. Expected like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )
Magic call method for repository methods.
Reset internal state after changes have been persisted
Allow to iterate on an IterableResult and return a Generator
Finds all objects and return an IterableResult
Finds all objects by collection name and return an IterableResult
Finds other resources which are referring to the same resource data, filename and collection
Find all resources with the same SHA1 hash
Find all resources with the same SHA1 hash and collection
Counts all resources with the same SHA1 hash and collection
Find one resource by SHA1
No description
Details
__construct()
Constructor
string
getEntityClassName()
Returns the classname of the entities this repository is managing.
Note that anything that is an "instanceof" this class is accepted by the repository.
void
add(object $object)
No description
void
remove(object $object)
Removes a PersistentResource object from this repository
QueryResultInterface
findAll()
Returns all objects of this repository
object|null
findByIdentifier(mixed $identifier)
Finds an object matching the given identifier.
QueryInterface
createQuery()
Returns a query for objects of this repository
int
countAll()
Counts all objects of this repository
void
removeAll()
Removes all objects of this repository as if remove() was called for all of them.
void
setDefaultOrderings(array $defaultOrderings)
Sets the property names to order results by. Expected like this: array( 'foo' => \Neos\Flow\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \Neos\Flow\Persistence\QueryInterface::ORDER_DESCENDING )
void
update(object $object)
Schedules a modified object for persistence.
mixed
__call(string $method, array $arguments)
Magic call method for repository methods.
Provides three methods
- findBy
($value, $caseSensitive = true, $cacheResult = false) - findOneBy
($value, $caseSensitive = true, $cacheResult = false) - countBy
($value, $caseSensitive = true)
void
resetAfterPersistingChanges()
Reset internal state after changes have been persisted
Generator
iterate(IterableResult $iterator, callable $callback = null)
Allow to iterate on an IterableResult and return a Generator
This methos is useful for batch processing huge result set. The callback is executed after every iteration. It can be used to clear the state of the persistence layer.
IterableResult
findAllIterator()
Finds all objects and return an IterableResult
IterableResult
findByCollectionNameIterator(string $collectionName)
Finds all objects by collection name and return an IterableResult
QueryResultInterface
findSimilarResources(PersistentResource $resource)
Finds other resources which are referring to the same resource data, filename and collection
array
findBySha1(string $sha1Hash)
Find all resources with the same SHA1 hash
array
findBySha1AndCollectionName(string $sha1Hash, string $collectionName)
Find all resources with the same SHA1 hash and collection
int
countBySha1AndCollectionName(string $sha1Hash, string $collectionName)
Counts all resources with the same SHA1 hash and collection
PersistentResource
findOneBySha1(string $sha1Hash)
Find one resource by SHA1
SplObjectStorage
getAddedResources()
No description