PHP Класс Doctrine\OXM\XmlEntityManager

Наследование: implements Doctrine\Common\Persistence\ObjectManager
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__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