PHP Класс Doctrine\ODM\MongoDB\DocumentRepository

This class is designed for inheritance and users can subclass this class to write their own repositories with business-specific methods to locate documents.
С версии: 1.0
Автор: Jonathan H. Wage ([email protected])
Автор: Roman Borschel ([email protected])
Наследование: implements Doctrine\Common\Persistence\ObjectRepository, implements Doctrine\Common\Collections\Selectable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata
$dm DocumentManager
$documentName string
$uow UnitOfWork

Открытые методы

Метод Описание
__call ( string $method, array $arguments ) : array | object Adds support for magic finders.
__construct ( DocumentManager $dm, UnitOfWork $uow, ClassMetadata $classMetadata ) Initializes this instance with the specified document manager, unit of work and class metadata.
clear ( ) Clears the repository, causing all managed documents to become detached.
createAggregationBuilder ( ) : Builder Creates a new Aggregation\Builder instance that is prepopulated for this document name.
createQueryBuilder ( ) : Builder Creates a new Query\Builder instance that is preconfigured for this document name.
find ( mixed $id, integer $lockMode = LockMode::NONE, integer $lockVersion = null ) : object | null Finds a document matching the specified identifier. Optionally a lock mode and expected version may be specified.
findAll ( ) : array Finds all documents in the repository.
findBy ( array $criteria, array $sort = null, integer | null $limit = null, integer | null $skip = null ) : array Finds documents by a set of criteria.
findOneBy ( array $criteria ) : object Finds a single document by a set of criteria.
getClassMetadata ( ) : ClassMetadata
getClassName ( ) : string
getDocumentManager ( ) : DocumentManager
getDocumentName ( ) : string
matching ( Doctrine\Common\Collections\Criteria $criteria ) : Doctrine\Common\Collections\Collection Selects all elements from a selectable that match the expression and returns a new collection containing these elements.

Защищенные методы

Метод Описание
getDocumentPersister ( )

Описание методов

__call() публичный Метод

Adds support for magic finders.
public __call ( string $method, array $arguments ) : array | object
$method string
$arguments array
Результат array | object The found document/documents.

__construct() публичный Метод

Initializes this instance with the specified document manager, unit of work and class metadata.
public __construct ( DocumentManager $dm, UnitOfWork $uow, ClassMetadata $classMetadata )
$dm DocumentManager The DocumentManager to use.
$uow UnitOfWork The UnitOfWork to use.
$classMetadata Doctrine\ODM\MongoDB\Mapping\ClassMetadata The class metadata.

clear() публичный Метод

Clears the repository, causing all managed documents to become detached.
public clear ( )

createAggregationBuilder() публичный Метод

Creates a new Aggregation\Builder instance that is prepopulated for this document name.
public createAggregationBuilder ( ) : Builder
Результат Doctrine\ODM\MongoDB\Aggregation\Builder

createQueryBuilder() публичный Метод

Creates a new Query\Builder instance that is preconfigured for this document name.
public createQueryBuilder ( ) : Builder
Результат Doctrine\ODM\MongoDB\Query\Builder $qb

find() публичный Метод

Finds a document matching the specified identifier. Optionally a lock mode and expected version may be specified.
public find ( mixed $id, integer $lockMode = LockMode::NONE, integer $lockVersion = null ) : object | null
$id mixed Identifier.
$lockMode integer Optional. Lock mode; one of the LockMode constants.
$lockVersion integer Optional. Expected version.
Результат object | null The document, if found, otherwise null.

findAll() публичный Метод

Finds all documents in the repository.
public findAll ( ) : array
Результат array

findBy() публичный Метод

Finds documents by a set of criteria.
public findBy ( array $criteria, array $sort = null, integer | null $limit = null, integer | null $skip = null ) : array
$criteria array Query criteria
$sort array Sort array for Cursor::sort()
$limit integer | null Limit for Cursor::limit()
$skip integer | null Skip for Cursor::skip()
Результат array

findOneBy() публичный Метод

Finds a single document by a set of criteria.
public findOneBy ( array $criteria ) : object
$criteria array
Результат object

getClassMetadata() публичный Метод

public getClassMetadata ( ) : ClassMetadata
Результат Doctrine\ODM\MongoDB\Mapping\ClassMetadata

getClassName() публичный Метод

public getClassName ( ) : string
Результат string

getDocumentManager() публичный Метод

public getDocumentManager ( ) : DocumentManager
Результат DocumentManager

getDocumentName() публичный Метод

public getDocumentName ( ) : string
Результат string

getDocumentPersister() защищенный Метод

protected getDocumentPersister ( )

matching() публичный Метод

Selects all elements from a selectable that match the expression and returns a new collection containing these elements.
См. также: Selectable::matching()
public matching ( Doctrine\Common\Collections\Criteria $criteria ) : Doctrine\Common\Collections\Collection
$criteria Doctrine\Common\Collections\Criteria
Результат Doctrine\Common\Collections\Collection

Описание свойств

$class защищенное свойство

protected ClassMetadata,Doctrine\ODM\MongoDB\Mapping $class
Результат Doctrine\ODM\MongoDB\Mapping\ClassMetadata

$dm защищенное свойство

protected DocumentManager,Doctrine\ODM\MongoDB $dm
Результат DocumentManager

$documentName защищенное свойство

protected string $documentName
Результат string

$uow защищенное свойство

protected UnitOfWork,Doctrine\ODM\MongoDB $uow
Результат UnitOfWork