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
파일 보기 프로젝트 열기: doctrine/oxm

공개 메소드들

메소드 설명
__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.