PHP Класс Doctrine\Search\UnitOfWork

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( Doctrine\Search\SearchManager $sm ) Initializes a new UnitOfWork instance, bound to the given SearchManager.
clear ( string $entityName = null ) Clears the UnitOfWork.
commit ( null | object | array $entity = null ) Commits the UnitOfWork, executing all operations that have been postponed up to this point.
hydrateCollection ( array $classes, Traversable $resultSet ) Construct an entity collection
hydrateEntity ( ClassMetadata $class, object $document ) Construct an entity object
isInIdentityMap ( object $entity ) : boolean Checks whether an entity is registered in the identity map of this UnitOfWork.
load ( ClassMetadata $class, mixed $value, array $options = [] ) Load and hydrate a document model
loadCollection ( array $classes, unknown $query ) Load and hydrate a document collection
persist ( object $entity ) Persists an entity as part of the current unit of work.
remove ( object $entity ) Deletes an entity as part of the current unit of work.

Приватные методы

Метод Описание
commitPersisted ( ) Commit persisted entities to the database
commitRemoved ( ) Commit deleted entities to the database
sortObjects ( array $objects, boolean $serialize = true ) : array Prepare entities for commit. Entities scheduled for deletion do not need to be serialized.

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

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

Initializes a new UnitOfWork instance, bound to the given SearchManager.
public __construct ( Doctrine\Search\SearchManager $sm )
$sm Doctrine\Search\SearchManager

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

Clears the UnitOfWork.
public clear ( string $entityName = null )
$entityName string if given, only entities of this type will get detached

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

The operations are executed in the following order: 1) All entity inserts 2) All entity deletions
public commit ( null | object | array $entity = null )
$entity null | object | array

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

Construct an entity collection
public hydrateCollection ( array $classes, Traversable $resultSet )
$classes array
$resultSet Traversable

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

Construct an entity object
public hydrateEntity ( ClassMetadata $class, object $document )
$class Doctrine\Search\Mapping\ClassMetadata
$document object

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

Checks whether an entity is registered in the identity map of this UnitOfWork.
public isInIdentityMap ( object $entity ) : boolean
$entity object
Результат boolean

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

Load and hydrate a document model
public load ( ClassMetadata $class, mixed $value, array $options = [] )
$class Doctrine\Search\Mapping\ClassMetadata
$value mixed
$options array

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

Load and hydrate a document collection
public loadCollection ( array $classes, unknown $query )
$classes array
$query unknown

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

Persists an entity as part of the current unit of work.
public persist ( object $entity )
$entity object The entity to persist.

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

Deletes an entity as part of the current unit of work.
public remove ( object $entity )
$entity object The entity to remove.