PHP Класс AppserverIo\Appserver\PersistenceContainer\Doctrine\DoctrineEntityManagerProxy

Автор: Tim Wagner ([email protected])
Наследование: implements AppserverIo\RemoteMethodInvocation\RemoteObjectInterface, implements Doctrine\ORM\EntityManagerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$className string The class name to proxy.
$session AppserverIo\RemoteMethodInvocation\SessionInterface Holds the ContextSession for this proxy.

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

Метод Описание
__call ( string $method, array $params ) : mixed Invokes the remote execution of the passed remote method.
__construct ( mixed $className = 'AppserverIo\Appserver\Core\InitialContext' ) Initializes the proxy with the class name to proxy.
__create ( string $className ) : AppserverIo\RemoteMethodInvocation\RemoteObjectInterface Factory method to create a new instance of the requested proxy implementation.
__getClassName ( ) : string The name of the original object.
__getSession ( ) : AppserverIo\RemoteMethodInvocation\SessionInterface Returns the session instance.
__invoke ( AppserverIo\RemoteMethodInvocation\RemoteMethodInterface $methodCall, AppserverIo\RemoteMethodInvocation\SessionInterface $session ) : mixed Invokes the remote execution of the passed remote method.
__setSession ( AppserverIo\RemoteMethodInvocation\SessionInterface $session ) : AppserverIo\RemoteMethodInvocation\RemoteObjectInterface Sets the session with the connection instance.
beginTransaction ( ) : void Starts a transaction on the underlying database connection.
clear ( string | null $objectName = null ) : void Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.
close ( ) : void 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.
commit ( ) : void Commits a transaction on the underlying database connection.
contains ( object $object ) : boolean Checks if the object is part of the current UnitOfWork and therefore managed.
copy ( object $entity, boolean $deep = false ) : object Creates a copy of the given entity. Can create a shallow or a deep copy.
createNamedNativeQuery ( string $name ) : Doctrine\ORM\NativeQuery Creates a NativeQuery from a named native query.
createNamedQuery ( string $name ) : Doctrine\ORM\Query Creates a Query from a named query.
createNativeQuery ( string $sql, Doctrine\ORM\Query\ResultSetMapping $rsm ) : Doctrine\ORM\NativeQuery Creates a native SQL query.
createQuery ( string $dql = '' ) : Query Creates a new Query object.
createQueryBuilder ( ) : Doctrine\ORM\QueryBuilder Create a QueryBuilder instance
detach ( object $object ) : void Detaches an object from the ObjectManager, causing a managed object to become detached. Unflushed changes made to the object if any (including removal of the object), will not be synchronized to the database.
find ( string $entityName, mixed $id, integer | null $lockMode = null, integer | null $lockVersion = null ) : object | null Finds an Entity by its identifier.
flush ( null | object | array $entity = null ) : void Flushes all changes to objects that have been queued up to now to the database.
getCache ( ) : Doctrine\ORM\Cache | null Returns the cache API for managing the second level cache regions or NULL if the cache is not enabled.
getClassMetadata ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata Returns the ClassMetadata descriptor for a class.
getConfiguration ( ) : Doctrine\ORM\Configuration Gets the Configuration used by the EntityManager.
getConnection ( ) : Doctrine\DBAL\Connection Gets the database connection object used by the EntityManager.
getEventManager ( ) : Doctrine\Common\EventManager Gets the EventManager used by the EntityManager.
getExpressionBuilder ( ) : Doctrine\ORM\Query\Expr Gets an ExpressionBuilder used for object-oriented construction of query expressions.
getFilters ( ) : Doctrine\ORM\Query\FilterCollection Gets the enabled filters.
getHydrator ( integer $hydrationMode ) : Doctrine\ORM\Internal\Hydration\AbstractHydrator Gets a hydrator for the given hydration mode.
getMetadataFactory ( ) : Doctrine\Common\Persistence\Mapping\ClassMetadataFactory Gets the metadata factory used to gather the metadata of classes.
getPartialReference ( string $entityName, mixed $identifier ) : object Gets a partial reference to the entity identified by the given type and identifier without actually loading it, if the entity is not yet loaded.
getProxyFactory ( ) : Doctrine\ORM\Proxy\ProxyFactory Gets the proxy factory used by the EntityManager to create entity proxies.
getReference ( string $entityName, mixed $id ) : object Gets a reference to the entity identified by the given type and identifier without actually loading it, if the entity is not yet loaded.
getRepository ( string $className ) : Doctrine\Common\Persistence\ObjectRepository Gets the repository for a class.
getUnitOfWork ( ) : UnitOfWork Gets the UnitOfWork used by the EntityManager to coordinate operations.
hasFilters ( ) : boolean Checks whether the Entity Manager has filters.
initializeObject ( object $obj ) : void Helper method to initialize a lazy loading proxy or persistent collection.
isFiltersStateClean ( ) : boolean Checks whether the state of the filter collection is clean.
isOpen ( ) : boolean Check if the Entity manager is open or closed.
lock ( object $entity, integer $lockMode, integer | null $lockVersion = null ) : void Acquire a lock on the given entity.
merge ( object $object ) : object Merges the state of a detached object into the persistence context of this ObjectManager and returns the managed copy of the object.
newHydrator ( integer $hydrationMode ) : Doctrine\ORM\Internal\Hydration\AbstractHydrator Create a new instance for the given hydration mode.
persist ( object $object ) : void Tells the ObjectManager to make an instance managed and persistent.
refresh ( object $object ) : void Refreshes the persistent state of an object from the database, overriding any local changes that have not yet been persisted.
remove ( object $object ) : void Removes an object instance.
rollback ( ) : void Performs a rollback on the underlying database connection.
transactional ( callable $func ) : mixed Executes a function in a transaction.

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

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

Invokes the remote execution of the passed remote method.
public __call ( string $method, array $params ) : mixed
$method string The remote method to call
$params array The parameters for the method call
Результат mixed The result of the remote method call

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

Initializes the proxy with the class name to proxy.
public __construct ( mixed $className = 'AppserverIo\Appserver\Core\InitialContext' )
$className mixed The name of the class to create the proxy for

__create() публичный статический метод

Factory method to create a new instance of the requested proxy implementation.
public static __create ( string $className ) : AppserverIo\RemoteMethodInvocation\RemoteObjectInterface
$className string The name of the class to create the proxy for
Результат AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy instance

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

The name of the original object.
См. также: AppserverIo\RemoteMethodInvocation\RemoteObjectInterface::__getClassName()
public __getClassName ( ) : string
Результат string The name of the original object

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

Returns the session instance.
См. также: AppserverIo\RemoteMethodInvocation\RemoteObjectInterface::__getSession()
public __getSession ( ) : AppserverIo\RemoteMethodInvocation\SessionInterface
Результат AppserverIo\RemoteMethodInvocation\SessionInterface The session instance

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

Invokes the remote execution of the passed remote method.
public __invoke ( AppserverIo\RemoteMethodInvocation\RemoteMethodInterface $methodCall, AppserverIo\RemoteMethodInvocation\SessionInterface $session ) : mixed
$methodCall AppserverIo\RemoteMethodInvocation\RemoteMethodInterface The remote method call instance
$session AppserverIo\RemoteMethodInvocation\SessionInterface The session with the connection instance to use
Результат mixed The result of the remote method call

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

Sets the session with the connection instance.
public __setSession ( AppserverIo\RemoteMethodInvocation\SessionInterface $session ) : AppserverIo\RemoteMethodInvocation\RemoteObjectInterface
$session AppserverIo\RemoteMethodInvocation\SessionInterface The session instance to use
Результат AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The instance itself

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

Starts a transaction on the underlying database connection.
public beginTransaction ( ) : void
Результат void

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

Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.
public clear ( string | null $objectName = null ) : void
$objectName string | null if given, only objects of this type will get detached.
Результат void

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 ( ) : void
Результат void

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

Commits a transaction on the underlying database connection.
public commit ( ) : void
Результат void

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

Checks if the object is part of the current UnitOfWork and therefore managed.
public contains ( object $object ) : boolean
$object object The object to check
Результат boolean

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

Creates a copy of the given entity. Can create a shallow or a deep copy.
public copy ( object $entity, boolean $deep = false ) : object
$entity object The entity to copy.
$deep boolean FALSE for a shallow copy, TRUE for a deep copy.
Результат object The new entity.

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

Creates a NativeQuery from a named native query.
public createNamedNativeQuery ( string $name ) : Doctrine\ORM\NativeQuery
$name string The query name
Результат Doctrine\ORM\NativeQuery The query instance

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

Creates a Query from a named query.
public createNamedQuery ( string $name ) : Doctrine\ORM\Query
$name string The query name
Результат Doctrine\ORM\Query

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

Creates a native SQL query.
public createNativeQuery ( string $sql, Doctrine\ORM\Query\ResultSetMapping $rsm ) : Doctrine\ORM\NativeQuery
$sql string The SQL command
$rsm Doctrine\ORM\Query\ResultSetMapping The ResultSetMapping to use
Результат Doctrine\ORM\NativeQuery The query instance

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

Creates a new Query object.
public createQuery ( string $dql = '' ) : Query
$dql string The DQL string.
Результат Query

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

Create a QueryBuilder instance
public createQueryBuilder ( ) : Doctrine\ORM\QueryBuilder
Результат Doctrine\ORM\QueryBuilder The query builder instance

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

Objects which previously referenced the detached object will continue to reference it.
public detach ( object $object ) : void
$object object The object to detach.
Результат void

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

Finds an Entity by its identifier.
public find ( string $entityName, mixed $id, integer | null $lockMode = null, integer | null $lockVersion = null ) : object | null
$entityName string The class name of the entity to find.
$id mixed The identity of the entity to find.
$lockMode integer | null One of the \Doctrine\DBAL\LockMode::* constants or NULL if no specific lock mode should be used during the search.
$lockVersion integer | null The version of the entity to find when using optimistic locking.
Результат object | null The entity instance or NULL if the entity can not be found.

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

This effectively synchronizes the in-memory state of managed objects with the database. If an entity is explicitly passed to this method only this entity and the cascade-persist semantics + scheduled inserts/removals are synchronized.
public flush ( null | object | array $entity = null ) : void
$entity null | object | array The entity to be synchronized
Результат void

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

Returns the cache API for managing the second level cache regions or NULL if the cache is not enabled.
public getCache ( ) : Doctrine\ORM\Cache | null
Результат Doctrine\ORM\Cache | null

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

The class name must be the fully-qualified class name without a leading backslash (as it is returned by get_class($obj)).
public getClassMetadata ( string $className ) : Doctrine\Common\Persistence\Mapping\ClassMetadata
$className string The class name to return the metadata for
Результат Doctrine\Common\Persistence\Mapping\ClassMetadata

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

Gets the Configuration used by the EntityManager.
public getConfiguration ( ) : Doctrine\ORM\Configuration
Результат Doctrine\ORM\Configuration The configuration

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

Gets the database connection object used by the EntityManager.
public getConnection ( ) : Doctrine\DBAL\Connection
Результат Doctrine\DBAL\Connection

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

Gets the EventManager used by the EntityManager.
public getEventManager ( ) : Doctrine\Common\EventManager
Результат Doctrine\Common\EventManager The event manager

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

Example: $qb = $em->createQueryBuilder(); $expr = $em->getExpressionBuilder(); $qb->select('u')->from('User', 'u') ->where($expr->orX($expr->eq('u.id', 1), $expr->eq('u.id', 2)));
public getExpressionBuilder ( ) : Doctrine\ORM\Query\Expr
Результат Doctrine\ORM\Query\Expr

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

Gets the enabled filters.
public getFilters ( ) : Doctrine\ORM\Query\FilterCollection
Результат Doctrine\ORM\Query\FilterCollection The active filter collection

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

This method caches the hydrator instances which is used for all queries that don't selectively iterate over the result.
Устаревший:
public getHydrator ( integer $hydrationMode ) : Doctrine\ORM\Internal\Hydration\AbstractHydrator
$hydrationMode integer The hydration mode to use
Результат Doctrine\ORM\Internal\Hydration\AbstractHydrator

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

Gets the metadata factory used to gather the metadata of classes.
public getMetadataFactory ( ) : Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
Результат Doctrine\Common\Persistence\Mapping\ClassMetadataFactory

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

The returned reference may be a partial object if the entity is not yet loaded/managed. If it is a partial object it will not initialize the rest of the entity state on access. Thus you can only ever safely access the identifier of an entity obtained through this method. The use-cases for partial references involve maintaining bidirectional associations without loading one side of the association or to update an entity without loading it. Note, however, that in the latter case the original (persistent) entity data will never be visible to the application (especially not event listeners) as it will never be loaded in the first place.
public getPartialReference ( string $entityName, mixed $identifier ) : object
$entityName string The name of the entity type.
$identifier mixed The entity identifier.
Результат object The (partial) entity reference.

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

Gets the proxy factory used by the EntityManager to create entity proxies.
public getProxyFactory ( ) : Doctrine\ORM\Proxy\ProxyFactory
Результат Doctrine\ORM\Proxy\ProxyFactory The proxy factory

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

Gets a reference to the entity identified by the given type and identifier without actually loading it, if the entity is not yet loaded.
public getReference ( string $entityName, mixed $id ) : object
$entityName string The name of the entity type.
$id mixed The entity identifier.
Результат object The entity reference.

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

Gets the repository for a class.
public getRepository ( string $className ) : Doctrine\Common\Persistence\ObjectRepository
$className string The class name to return the repository for
Результат Doctrine\Common\Persistence\ObjectRepository

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

Gets the UnitOfWork used by the EntityManager to coordinate operations.
public getUnitOfWork ( ) : UnitOfWork
Результат Doctrine\ORM\UnitOfWork The unit of work

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

Checks whether the Entity Manager has filters.
public hasFilters ( ) : boolean
Результат boolean TRUE, if the EM has a filter collection

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

This method is a no-op for other objects.
public initializeObject ( object $obj ) : void
$obj object The object to be initialized
Результат void

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

Checks whether the state of the filter collection is clean.
public isFiltersStateClean ( ) : boolean
Результат boolean TRUE, if the filter collection is clean

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

Check if the Entity manager is open or closed.
public isOpen ( ) : boolean
Результат boolean TRUE if the EM is open

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

Acquire a lock on the given entity.
public lock ( object $entity, integer $lockMode, integer | null $lockVersion = null ) : void
$entity object The entity to be locked
$lockMode integer The lock mode
$lockVersion integer | null The lock version
Результат void

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

The object passed to merge will not become associated/managed with this ObjectManager.
public merge ( object $object ) : object
$object object The object to be merged
Результат object The merge instance

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

Create a new instance for the given hydration mode.
public newHydrator ( integer $hydrationMode ) : Doctrine\ORM\Internal\Hydration\AbstractHydrator
$hydrationMode integer The hydration mode to use
Результат Doctrine\ORM\Internal\Hydration\AbstractHydrator

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

The object will be entered into the database as a result of the flush operation. NOTE: The persist operation always considers objects that are not yet known to this ObjectManager as NEW. Do not pass detached objects to the persist operation.
public persist ( object $object ) : void
$object object The instance to make managed and persistent.
Результат void

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

Refreshes the persistent state of an object from the database, overriding any local changes that have not yet been persisted.
public refresh ( object $object ) : void
$object object The object to refresh.
Результат void

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

A removed object will be removed from the database as a result of the flush operation.
public remove ( object $object ) : void
$object object The object instance to remove.
Результат void

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

Performs a rollback on the underlying database connection.
public rollback ( ) : void
Результат void

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

The function gets passed this EntityManager instance as an (optional) parameter. {@link flush} is invoked prior to transaction commit. If an exception occurs during execution of the function or flushing or transaction commit, the transaction is rolled back, the EntityManager closed and the exception re-thrown.
public transactional ( callable $func ) : mixed
$func callable The function to execute transactionally.
Результат mixed The non-empty value returned from the closure or true instead.

Описание свойств

$className защищенное свойство

The class name to proxy.
protected string $className
Результат string

$session защищенное свойство

Holds the ContextSession for this proxy.
protected SessionInterface,AppserverIo\RemoteMethodInvocation $session
Результат AppserverIo\RemoteMethodInvocation\SessionInterface