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.

object[]
findAll()

Finds all objects in the repository.

object[]
findBy(array $criteria, array|null $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.

object[] findAll()

Finds all objects in the repository.

Return Value

object[] The objects.

object[] findBy(array $criteria, array|null $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|null $orderBy
int|null $limit
int|null $offset

Return Value

object[] 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