PHP 클래스 Doctrine\OXM\XmlEntityManager

상속: implements Doctrine\Common\Persistence\ObjectManager
파일 보기 프로젝트 열기: doctrine/oxm 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Doctrine\OXM\Storage\Storage $storage, Configuration $config, Doctrine\Common\EventManager $eventManager = null ) Creates a new XmlEntityManager that uses the given Configuration and EventManager implementations.
clear ( string $entityName = null ) Clears the EntityManager. All entities that are currently managed by this EntityManager become detached.
close ( ) Closes the EntityManager. All entities that are currently managed by this EntityManager become detached. The EntityManager may no longer be used after it is closed.
detach ( object $entity ) Detaches an entity from the XmlEntityManager, causing a managed entity to become detached. Unflushed changes made to the entity if any (including removal of the entity), will not be synchronized to the filesystem.
find ( string $entityName, mixed $identifier, integer $lockMode = LockMode::NONE, integer $lockVersion = null ) : object Finds an Entity by its identifier.
flush ( ) Flushes all changes to objects that have been queued up to now to the filesystem.
getClassMetadata ( $className ) : ClassMetadata Returns the OXM mapping descriptor for a class.
getConfiguration ( ) : Configuration
getEventManager ( ) : Doctrine\Common\EventManager
getMarshaller ( ) : Doctrine\OXM\Marshaller\Marshaller\Marshaller
getMetadataFactory ( ) : ClassMetadataFactory Gets the metadata factory used to gather the metadata of classes.
getProxyFactory ( ) : ProxyFactory Gets the proxy factory used by the XmlEntityManager to create xml-entity proxies.
getRepository ( string $entityName ) : Doctrine\Common\Persistence\ObjectRepository Gets the repository for a class.
getStorage ( ) : Doctrine\OXM\Storage\XmlStorage
getUnitOfWork ( ) : UnitOfWork Gets the UnitOfWork used by the EntityManager to coordinate operations.
isOpen ( ) : boolean Check if the Entity manager is open or closed.
marshal ( object $object ) : string Marshals a mapped object into XML
merge ( object $entity ) : object Merges the state of a detached entity into the persistence context of this XmlEntityManager and returns the managed copy of the entity.
persist ( $entity ) Tells the XmlEntityManager to make an instance managed and persistent.
refresh ( object $entity ) Refreshes the persistent state of an entity from the filesystem, overriding any local changes that have not yet been persisted.
remove ( object $entity ) Removes an entity instance.
unmarshal ( string $xml ) : object Unmarshals XML into mapped objects

비공개 메소드들

메소드 설명
errorIfClosed ( ) Throws an exception if the EntityManager is closed or currently not active.

메소드 상세

__construct() 공개 메소드

Creates a new XmlEntityManager that uses the given Configuration and EventManager implementations.
public __construct ( Doctrine\OXM\Storage\Storage $storage, Configuration $config, Doctrine\Common\EventManager $eventManager = null )
$storage Doctrine\OXM\Storage\Storage
$config Configuration
$eventManager Doctrine\Common\EventManager

clear() 공개 메소드

Clears the EntityManager. All entities that are currently managed by this EntityManager become detached.
public clear ( string $entityName = null )
$entityName string

close() 공개 메소드

Closes the EntityManager. All entities that are currently managed by this EntityManager become detached. The EntityManager may no longer be used after it is closed.
public close ( )

detach() 공개 메소드

Entities which previously referenced the detached entity will continue to reference it.
public detach ( object $entity )
$entity object The entity to detach.

find() 공개 메소드

This is just a convenient shortcut for getRepository($entityName)->find($id).
public find ( string $entityName, mixed $identifier, integer $lockMode = LockMode::NONE, integer $lockVersion = null ) : object
$entityName string
$identifier mixed
$lockMode integer
$lockVersion integer
리턴 object

flush() 공개 메소드

This effectively synchronizes the in-memory state of managed objects with the filesystem.
public flush ( )

getClassMetadata() 공개 메소드

The class name must be the fully-qualified class name without a leading backslash (as it is returned by get_class($obj)) or an aliased class name. Examples: MyProject\Domain\User sales:PriceRequest
public getClassMetadata ( $className ) : ClassMetadata
리턴 Doctrine\OXM\Mapping\ClassMetadata

getConfiguration() 공개 메소드

public getConfiguration ( ) : Configuration
리턴 Configuration

getEventManager() 공개 메소드

public getEventManager ( ) : Doctrine\Common\EventManager
리턴 Doctrine\Common\EventManager

getMarshaller() 공개 메소드

public getMarshaller ( ) : Doctrine\OXM\Marshaller\Marshaller\Marshaller
리턴 Doctrine\OXM\Marshaller\Marshaller\Marshaller

getMetadataFactory() 공개 메소드

Gets the metadata factory used to gather the metadata of classes.
public getMetadataFactory ( ) : ClassMetadataFactory
리턴 Doctrine\OXM\Mapping\ClassMetadataFactory

getProxyFactory() 공개 메소드

Gets the proxy factory used by the XmlEntityManager to create xml-entity proxies.
public getProxyFactory ( ) : ProxyFactory
리턴 Doctrine\OXM\Proxy\ProxyFactory

getRepository() 공개 메소드

Gets the repository for a class.
public getRepository ( string $entityName ) : Doctrine\Common\Persistence\ObjectRepository
$entityName string
리턴 Doctrine\Common\Persistence\ObjectRepository

getStorage() 공개 메소드

public getStorage ( ) : Doctrine\OXM\Storage\XmlStorage
리턴 Doctrine\OXM\Storage\XmlStorage

getUnitOfWork() 공개 메소드

Gets the UnitOfWork used by the EntityManager to coordinate operations.
public getUnitOfWork ( ) : UnitOfWork
리턴 UnitOfWork

isOpen() 공개 메소드

Check if the Entity manager is open or closed.
public isOpen ( ) : boolean
리턴 boolean

marshal() 공개 메소드

Marshals a mapped object into XML
public marshal ( object $object ) : string
$object object
리턴 string

merge() 공개 메소드

The entity passed to merge will not become associated/managed with this XmlEntityManager.
public merge ( object $entity ) : object
$entity object The detached entity to merge into the persistence context.
리턴 object The managed copy of the entity.

persist() 공개 메소드

The entity will be entered into the filesystem at or before transaction commit or as a result of the flush operation. NOTE: The persist operation always considers entities that are not yet known to this XmlEntityManager as NEW. Do not pass detached entities to the persist operation.
public persist ( $entity )

refresh() 공개 메소드

Refreshes the persistent state of an entity from the filesystem, overriding any local changes that have not yet been persisted.
public refresh ( object $entity )
$entity object The entity to refresh.

remove() 공개 메소드

A removed entity will be removed from the filesystem at or before transaction commit or as a result of the flush operation.
public remove ( object $entity )
$entity object The entity instance to remove.

unmarshal() 공개 메소드

Unmarshals XML into mapped objects
public unmarshal ( string $xml ) : object
$xml string
리턴 object