RepositoryInterface

Contract for a repository

Tags
template

Table of Contents

Methods

add()  : mixed
Adds an object to this repository.
countAll()  : int
Returns the total number objects of this repository.
createQuery()  : QueryInterface<string|int, T>
Returns a query for objects of this repository
findAll()  : iterable<string|int, T>
Returns all objects of this repository.
findByIdentifier()  : T|null
Finds an object matching the given identifier.
findByUid()  : T|null
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(T $object) : mixed
Parameters
$object : T

The object to add

countAll()

Returns the total number objects of this repository.

public countAll() : int
Return values
int —

The object count

findAll()

Returns all objects of this repository.

public findAll() : iterable<string|int, T>
Return values
iterable<string|int, T> —

The iterable query result

findByIdentifier()

Finds an object matching the given identifier.

public findByIdentifier(mixed $identifier) : T|null
Parameters
$identifier : mixed

The identifier of the object to find

Return values
T|null —

The matching object if found, otherwise NULL

findByUid()

Finds an object matching the given identifier.

public findByUid(int $uid) : T|null
Parameters
$uid : int

The identifier of the object to find

Return values
T|null —

The matching object if found, otherwise NULL

remove()

Removes an object from this repository.

public remove(T $object) : mixed
Parameters
$object : T

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(T $modifiedObject) : mixed
Parameters
$modifiedObject : T

The modified object

On this page

Search results