PHP Класс Doctrine\OXM\UnitOfWork

This UnitOfWork is only capable of persisting xml class which are mapped via the @XmlRootEntity element. This ensures that @XmlId fields exist, and the persister knows how to save the xml correctly.
С версии: 2.0
Автор: Richard Fullmer ([email protected])
Наследование: implements Doctrine\Common\PropertyChangedListener
Показать файл Открыть проект

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

Метод Описание
__construct ( XmlEntityManager $xem ) Initializes a new UnitOfWork instance, bound to the given EntityManager.
addToIdentityMap ( object $xmlEntity ) : boolean INTERNAL: Registers an document in the identity map.
clear ( ) Clears the UnitOfWork.
commit ( array $options = [] )
detach ( object $xmlEntity ) Detaches an xml-entity from the persistence management. It's persistence will no longer be managed by Doctrine.
getXmlEntityPersister ( string $entityName ) : RootXmlEntityPersister Gets the EntityPersister for an Entity.
getXmlEntityState ( object $xmlEntity, integer $assume = null ) : integer Gets the state of an xml entity within the current unit of work.
isInIdentityMap ( object $entity ) : boolean Checks whether an entity is registered in the identity map of this UnitOfWork.
isScheduledForInsert ( object $entity ) : boolean Checks whether an entity is scheduled for insertion.
merge ( object $xmlEntity ) : object Merges the state of the given detached xml-entity into this UnitOfWork.
persist ( object $xmlEntity ) Persists an xml entity as part of the current unit of work.
propertyChanged ( $entity, string $propertyName, mixed $oldValue, mixed $newValue ) Notifies the listener of a property change.
refresh ( $xmlEntity )
remove ( $xmlEntity )
removeFromIdentityMap ( object $entity ) : boolean INTERNAL: Removes an entity from the identity map. This effectively detaches the entity from the persistence management of Doctrine.
scheduleForDelete ( object $xmlEntity ) INTERNAL: Schedules an entity for deletion.
scheduleForDirtyCheck ( object $xmlEntity ) Schedules a xml entity for dirty-checking at commit-time.
scheduleForInsert ( object $xmlEntity ) Schedules an document for insertion into the database.
tryGetById ( string $id, string $rootClassName ) : mixed INTERNAL: Tries to get an document by its identifier hash. If no document is found for the given hash, FALSE is returned.

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

Метод Описание
doDetach ( object $xmlEntity, array &$visited ) Executes a detach operation on the given xml-entity.
doPersist ( object $xmlEntity, array &$visited ) Saves an document as part of the current unit of work.
doRefresh ( object $xmlEntity, array &$visited ) Executes a refresh operation on an xml-entity.
doRemove ( $xmlEntity, array &$visited )
executeDeletions ( ClassMetadata $class, array $options = [] ) Executes all document deletions for documents of the specified type.
executeInserts ( ClassMetadata $class, array $options = [] ) Executes all document insertions for documents of the specified type.
executeUpdates ( ClassMetadata $class, array $options = [] ) Executes all xml entity updates for documents of the specified type.
persistNew ( ClassMetadata $class, $xmlEntity ) : void

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

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

Initializes a new UnitOfWork instance, bound to the given EntityManager.
public __construct ( XmlEntityManager $xem )
$xem XmlEntityManager

addToIdentityMap() публичный метод

Note that documents in a hierarchy are registered with the class name of the root document.
public addToIdentityMap ( object $xmlEntity ) : boolean
$xmlEntity object The document to register.
Результат boolean TRUE if the registration was successful, FALSE if the identity of the document in question is already managed.

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

Clears the UnitOfWork.
public clear ( )

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

public commit ( array $options = [] )
$options array

detach() публичный метод

Detaches an xml-entity from the persistence management. It's persistence will no longer be managed by Doctrine.
public detach ( object $xmlEntity )
$xmlEntity object The xml-entity to detach.

getXmlEntityPersister() публичный метод

Gets the EntityPersister for an Entity.
public getXmlEntityPersister ( string $entityName ) : RootXmlEntityPersister
$entityName string The name of the Entity.
Результат Doctrine\OXM\Persisters\RootXmlEntityPersister

getXmlEntityState() публичный метод

NOTE: This method sees xml entities that are not MANAGED or REMOVED and have a populated identifier, whether it is generated or manually assigned, as DETACHED. This can be incorrect for manually assigned identifiers.
public getXmlEntityState ( object $xmlEntity, integer $assume = null ) : integer
$xmlEntity object
$assume integer The state to assume if the state is not yet known. This is usually used to avoid costly state lookups, in the worst case with a filesystem lookup.
Результат integer The document state.

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

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

isScheduledForInsert() публичный метод

Checks whether an entity is scheduled for insertion.
public isScheduledForInsert ( object $entity ) : boolean
$entity object
Результат boolean

merge() публичный метод

Merges the state of the given detached xml-entity into this UnitOfWork.
public merge ( object $xmlEntity ) : object
$xmlEntity object
Результат object The managed copy of the xml-entity.

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

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

propertyChanged() публичный метод

Notifies the listener of a property change.
public propertyChanged ( $entity, string $propertyName, mixed $oldValue, mixed $newValue )
$propertyName string The name of the property that changed.
$oldValue mixed The old value of the property that changed.
$newValue mixed The new value of the property that changed.

refresh() публичный метод

public refresh ( $xmlEntity )

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

public remove ( $xmlEntity )

removeFromIdentityMap() публичный метод

INTERNAL: Removes an entity from the identity map. This effectively detaches the entity from the persistence management of Doctrine.
public removeFromIdentityMap ( object $entity ) : boolean
$entity object
Результат boolean

scheduleForDelete() публичный метод

INTERNAL: Schedules an entity for deletion.
public scheduleForDelete ( object $xmlEntity )
$xmlEntity object

scheduleForDirtyCheck() публичный метод

Schedules a xml entity for dirty-checking at commit-time.
public scheduleForDirtyCheck ( object $xmlEntity )
$xmlEntity object The xml entity to schedule for dirty-checking.

scheduleForInsert() публичный метод

If the document already has an identifier, it will be added to the identity map.
public scheduleForInsert ( object $xmlEntity )
$xmlEntity object The document to schedule for insertion.

tryGetById() публичный метод

INTERNAL: Tries to get an document by its identifier hash. If no document is found for the given hash, FALSE is returned.
public tryGetById ( string $id, string $rootClassName ) : mixed
$id string
$rootClassName string
Результат mixed The found document or FALSE.