interface ObjectRepository (View source)

Contract for a Doctrine persistence layer ObjectRepository class to implement.

Methods

object|null
find(mixed $id)

Finds an object by its primary key / identifier.

array
findAll()

Finds all objects in the repository.

array
findBy(array $criteria, array $orderBy = null, int|null $limit = null, int|null $offset = null)

Finds objects by a set of criteria.

object|null
findOneBy(array $criteria)

Finds a single object by a set of criteria.

string
getClassName()

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

Details

object|null find(mixed $id)

Finds an object by its primary key / identifier.

Parameters

mixed $id The identifier.

Return Value

object|null The object.

array findAll()

Finds all objects in the repository.

Return Value

array The objects.

array findBy(array $criteria, array $orderBy = null, int|null $limit = null, int|null $offset = null)

Finds objects by a set of criteria.

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

array $criteria
array $orderBy
int|null $limit
int|null $offset

Return Value

array The objects.

Exceptions

UnexpectedValueException

object|null findOneBy(array $criteria)

Finds a single object by a set of criteria.

Parameters

array $criteria The criteria.

Return Value

object|null The object.

string getClassName()

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

Return Value

string