interface ObjectRepository (View source)

Contract for a Doctrine persistence layer ObjectRepository class to implement.

Methods

object
find($id)

Finds an object by its primary key / identifier.

mixed
findAll()

Finds all objects in the repository.

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

Finds objects by a set of criteria.

object
findOneBy(array $criteria)

Finds a single object by a set of criteria.

Details

object find($id)

Finds an object by its primary key / identifier.

Parameters

$id The identifier.

Return Value

object The object.

mixed findAll()

Finds all objects in the repository.

Return Value

mixed The objects.

mixed 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

mixed The objects.

Exceptions

UnexpectedValueException

object findOneBy(array $criteria)

Finds a single object by a set of criteria.

Parameters

array $criteria

Return Value

object The object.