PHP Class AppserverIo\Appserver\PersistenceContainer\Doctrine\DoctrineEntityManagerProxy

Inheritance: implements AppserverIo\RemoteMethodInvocation\RemoteObjectInterface, implements Doctrine\ORM\EntityManagerInterface
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Protected Properties

Свойство Type Description
$className string The class name to proxy.
$session AppserverIo\RemoteMethodInvocation\SessionInterface Holds the ContextSession for this proxy.

Méthodes publiques

Méthode Description
__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.

Method Details

__call() public méthode

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
Résultat mixed The result of the remote method call

__construct() public méthode

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() public static méthode

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
Résultat AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy instance

__getClassName() public méthode

The name of the original object.
See also: AppserverIo\RemoteMethodInvocation\RemoteObjectInterface::__getClassName()
public __getClassName ( ) : string
Résultat string The name of the original object

__getSession() public méthode

Returns the session instance.
See also: AppserverIo\RemoteMethodInvocation\RemoteObjectInterface::__getSession()
public __getSession ( ) : AppserverIo\RemoteMethodInvocation\SessionInterface
Résultat AppserverIo\RemoteMethodInvocation\SessionInterface The session instance

__invoke() public méthode

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
Résultat mixed The result of the remote method call

__setSession() public méthode

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
Résultat AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The instance itself

beginTransaction() public méthode

Starts a transaction on the underlying database connection.
public beginTransaction ( ) : void
Résultat void

clear() public méthode

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.
Résultat void

close() public méthode

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
Résultat void

commit() public méthode

Commits a transaction on the underlying database connection.
public commit ( ) : void
Résultat void

contains() public méthode

Checks if the object is part of the current UnitOfWork and therefore managed.
public contains ( object $object ) : boolean
$object object The object to check
Résultat boolean

copy() public méthode

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.
Résultat object The new entity.

createNamedNativeQuery() public méthode

Creates a NativeQuery from a named native query.
public createNamedNativeQuery ( string $name ) : Doctrine\ORM\NativeQuery
$name string The query name
Résultat Doctrine\ORM\NativeQuery The query instance

createNamedQuery() public méthode

Creates a Query from a named query.
public createNamedQuery ( string $name ) : Doctrine\ORM\Query
$name string The query name
Résultat Doctrine\ORM\Query

createNativeQuery() public méthode

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
Résultat Doctrine\ORM\NativeQuery The query instance

createQuery() public méthode

Creates a new Query object.
public createQuery ( string $dql = '' ) : Query
$dql string The DQL string.
Résultat Query

createQueryBuilder() public méthode

Create a QueryBuilder instance
public createQueryBuilder ( ) : Doctrine\ORM\QueryBuilder
Résultat Doctrine\ORM\QueryBuilder The query builder instance

detach() public méthode

Objects which previously referenced the detached object will continue to reference it.
public detach ( object $object ) : void
$object object The object to detach.
Résultat void

find() public méthode

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.
Résultat object | null The entity instance or NULL if the entity can not be found.

flush() public méthode

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
Résultat void

getCache() public méthode

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
Résultat Doctrine\ORM\Cache | null

getClassMetadata() public méthode

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
Résultat Doctrine\Common\Persistence\Mapping\ClassMetadata

getConfiguration() public méthode

Gets the Configuration used by the EntityManager.
public getConfiguration ( ) : Doctrine\ORM\Configuration
Résultat Doctrine\ORM\Configuration The configuration

getConnection() public méthode

Gets the database connection object used by the EntityManager.
public getConnection ( ) : Doctrine\DBAL\Connection
Résultat Doctrine\DBAL\Connection

getEventManager() public méthode

Gets the EventManager used by the EntityManager.
public getEventManager ( ) : Doctrine\Common\EventManager
Résultat Doctrine\Common\EventManager The event manager

getExpressionBuilder() public méthode

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
Résultat Doctrine\ORM\Query\Expr

getFilters() public méthode

Gets the enabled filters.
public getFilters ( ) : Doctrine\ORM\Query\FilterCollection
Résultat Doctrine\ORM\Query\FilterCollection The active filter collection

getHydrator() public méthode

This method caches the hydrator instances which is used for all queries that don't selectively iterate over the result.
Deprecation:
public getHydrator ( integer $hydrationMode ) : Doctrine\ORM\Internal\Hydration\AbstractHydrator
$hydrationMode integer The hydration mode to use
Résultat Doctrine\ORM\Internal\Hydration\AbstractHydrator

getMetadataFactory() public méthode

Gets the metadata factory used to gather the metadata of classes.
public getMetadataFactory ( ) : Doctrine\Common\Persistence\Mapping\ClassMetadataFactory
Résultat Doctrine\Common\Persistence\Mapping\ClassMetadataFactory

getPartialReference() public méthode

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.
Résultat object The (partial) entity reference.

getProxyFactory() public méthode

Gets the proxy factory used by the EntityManager to create entity proxies.
public getProxyFactory ( ) : Doctrine\ORM\Proxy\ProxyFactory
Résultat Doctrine\ORM\Proxy\ProxyFactory The proxy factory

getReference() public méthode

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.
Résultat object The entity reference.

getRepository() public méthode

Gets the repository for a class.
public getRepository ( string $className ) : Doctrine\Common\Persistence\ObjectRepository
$className string The class name to return the repository for
Résultat Doctrine\Common\Persistence\ObjectRepository

getUnitOfWork() public méthode

Gets the UnitOfWork used by the EntityManager to coordinate operations.
public getUnitOfWork ( ) : UnitOfWork
Résultat Doctrine\ORM\UnitOfWork The unit of work

hasFilters() public méthode

Checks whether the Entity Manager has filters.
public hasFilters ( ) : boolean
Résultat boolean TRUE, if the EM has a filter collection

initializeObject() public méthode

This method is a no-op for other objects.
public initializeObject ( object $obj ) : void
$obj object The object to be initialized
Résultat void

isFiltersStateClean() public méthode

Checks whether the state of the filter collection is clean.
public isFiltersStateClean ( ) : boolean
Résultat boolean TRUE, if the filter collection is clean

isOpen() public méthode

Check if the Entity manager is open or closed.
public isOpen ( ) : boolean
Résultat boolean TRUE if the EM is open

lock() public méthode

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
Résultat void

merge() public méthode

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
Résultat object The merge instance

newHydrator() public méthode

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
Résultat Doctrine\ORM\Internal\Hydration\AbstractHydrator

persist() public méthode

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.
Résultat void

refresh() public méthode

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.
Résultat void

remove() public méthode

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.
Résultat void

rollback() public méthode

Performs a rollback on the underlying database connection.
public rollback ( ) : void
Résultat void

transactional() public méthode

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.
Résultat mixed The non-empty value returned from the closure or true instead.

Property Details

$className protected_oe property

The class name to proxy.
protected string $className
Résultat string

$session protected_oe property

Holds the ContextSession for this proxy.
protected SessionInterface,AppserverIo\RemoteMethodInvocation $session
Résultat AppserverIo\RemoteMethodInvocation\SessionInterface