RepositoryInterface

interface \TYPO3\CMS\Extbase\Persistence\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
Returns a query for objects of this repository
findAll()  : iterable<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

Tags

phpstan-param

T $object

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, mixed>

Tags

phpstan-return

iterable<T>

Return values

iterable<string|int, mixed> —

The iterable 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

Tags

phpstan-return

T|null

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

Tags

phpstan-return

T|null

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

Tags

phpstan-param

T $object

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 $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

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

Tags

phpstan-param

T $modifiedObject

On this page