RepositoryInterface
Contract for a repository
Table of Contents
Methods
- add() : mixed
- Adds an object to this repository.
- countAll() : int
- Returns the total number objects of this repository.
- createQuery() : QueryInterface
- Returns a query for objects of this repository
- findAll() : QueryResultInterface|array<string|int, mixed>
- Returns all objects of this repository.
- findByIdentifier() : object
- Finds an object matching the given identifier.
- findByUid() : object
- Finds an object matching the given identifier.
- remove() : mixed
- Removes an object from this repository.
- removeAll() : mixed
- Removes all objects of this repository as if remove() was called for all of them.
- setDefaultOrderings() : mixed
- Sets the property names to order the result by per default.
- setDefaultQuerySettings() : mixed
- Sets the default query settings to be used in this repository
- update() : mixed
- Replaces an existing object with the same identifier by the given object
Methods
add()
Adds an object to this repository.
public
add(object $object) : mixed
Parameters
- $object : object
-
The object to add
countAll()
Returns the total number objects of this repository.
public
countAll() : int
Return values
int —The object count
createQuery()
Returns a query for objects of this repository
public
createQuery() : QueryInterface
Return values
QueryInterfacefindAll()
Returns all objects of this repository.
public
findAll() : QueryResultInterface|array<string|int, mixed>
Return values
QueryResultInterface|array<string|int, mixed> —The query result
findByIdentifier()
Finds an object matching the given identifier.
public
findByIdentifier(mixed $identifier) : object
Parameters
- $identifier : mixed
-
The identifier of the object to find
Return values
object —The matching object if found, otherwise NULL
findByUid()
Finds an object matching the given identifier.
public
findByUid(int $uid) : object
Parameters
- $uid : int
-
The identifier of the object to find
Return values
object —The matching object if found, otherwise NULL
remove()
Removes an object from this repository.
public
remove(object $object) : mixed
Parameters
- $object : object
-
The object to remove
removeAll()
Removes all objects of this repository as if remove() was called for all of them.
public
removeAll() : mixed
setDefaultOrderings()
Sets the property names to order the result by per default.
public
setDefaultOrderings(array<string|int, mixed> $defaultOrderings) : mixed
Expected like this: array( 'foo' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING, 'bar' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING )
Parameters
- $defaultOrderings : array<string|int, mixed>
-
The property names to order by
setDefaultQuerySettings()
Sets the default query settings to be used in this repository
public
setDefaultQuerySettings(QuerySettingsInterface $defaultQuerySettings) : mixed
Parameters
- $defaultQuerySettings : QuerySettingsInterface
-
The query settings to be used by default
update()
Replaces an existing object with the same identifier by the given object
public
update(object $modifiedObject) : mixed
Parameters
- $modifiedObject : object
-
The modified object