class DocumentRepository implements ObjectRepository (View source)

An DocumentRepository serves as a repository for documents with generic as well as business specific methods for retrieving documents.

This class is designed for inheritance and users can subclass this class to write their own repositories with business-specific methods to locate documents.

Properties

protected string $documentName
protected string $documentType
protected DocumentManager $dm
protected ClassMetadata $class

Methods

__construct(DocumentManager $dm, ClassMetadata $class)

Initializes a new DocumentRepository.

object|null
find(mixed $id)

Find a single document by its identifier

void
refresh(object $document)

No description

array
findMany(array $ids, null|int $limit = null, null|int $offset = null)

Find Many documents of the given repositories type by id.

findAll()

No description

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

No description

findOneBy(array $criteria)

No description

string
getDocumentName()

No description

getClassMetadata()

No description

getClassName()

No description

Details

__construct(DocumentManager $dm, ClassMetadata $class)

Initializes a new DocumentRepository.

Parameters

DocumentManager $dm The DocumentManager to use.
ClassMetadata $class The class descriptor.

object|null find(mixed $id)

Find a single document by its identifier

Parameters

mixed $id A single identifier or an array of criteria.

Return Value

object|null $document

final void refresh(object $document)

Parameters

object $document

Return Value

void

array findMany(array $ids, null|int $limit = null, null|int $offset = null)

Find Many documents of the given repositories type by id.

Parameters

array $ids
null|int $limit
null|int $offset

Return Value

array

findAll()

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

Parameters

array $criteria
array $orderBy
$limit
$offset

findOneBy(array $criteria)

Parameters

array $criteria

string getDocumentName()

Return Value

string

DocumentManager getDocumentManager()

Return Value

DocumentManager

ClassMetadata getClassMetadata()

Return Value

ClassMetadata

getClassName()