Documentation

ObjectRepository

Contract for a Doctrine persistence layer ObjectRepository class to implement.

Tags
template-covariant

T of object

Table of Contents

Methods

find()  : object|null
Finds an object by its primary key / identifier.
findAll()  : array<int, object>
Finds all objects in the repository.
findBy()  : array<int, object>
Finds objects by a set of criteria.
findOneBy()  : object|null
Finds a single object by a set of criteria.
getClassName()  : mixed
Returns the class name of the object managed by the repository.

Methods

find()

Finds an object by its primary key / identifier.

public find(mixed $id) : object|null
Parameters
$id : mixed

The identifier.

Tags
psalm-return

T|null

Return values
object|null

The object.

findAll()

Finds all objects in the repository.

public findAll() : array<int, object>
Tags
psalm-return

T[]

Return values
array<int, object>

The objects.

findBy()

Finds objects by a set of criteria.

public findBy(array<string, mixed> $criteria[, array<string, string>|null $orderBy = null ][, int|null $limit = null ][, int|null $offset = null ]) : array<int, object>

Optionally sorting and limiting details can be passed. An implementation may throw an UnexpectedValueException if certain values of the sorting or limiting details are not supported.

Parameters
$criteria : array<string, mixed>
$orderBy : array<string, string>|null = null
$limit : int|null = null
$offset : int|null = null
Tags
psalm-param

array<string, 'asc'|'desc'|'ASC'|'DESC'>|null $orderBy

psalm-return

T[]

throws
UnexpectedValueException
Return values
array<int, object>

The objects.

findOneBy()

Finds a single object by a set of criteria.

public findOneBy(array<string, mixed> $criteria) : object|null
Parameters
$criteria : array<string, mixed>

The criteria.

Tags
psalm-return

T|null

Return values
object|null

The object.

getClassName()

Returns the class name of the object managed by the repository.

public getClassName() : mixed
Tags
psalm-return

class-string<T>


        
On this page

Search results