1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Use docblox from EntityManagerInterface

(cherry picked from commit 6d58824ac52a63928c5d5e9a9d0b9a184cd92c7e)
This commit is contained in:
Luís Otávio Cobucci Oblonczyk 2013-12-10 12:09:36 -02:00 committed by Mantas Varatiejus
parent 2b8e03ff12
commit ccbe849a72

View File

@ -165,9 +165,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets the database connection object used by the EntityManager. * {@inheritDoc}
*
* @return \Doctrine\DBAL\Connection
*/ */
public function getConnection() public function getConnection()
{ {
@ -185,18 +183,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets an ExpressionBuilder used for object-oriented construction of query expressions. * {@inheritDoc}
*
* Example:
*
* <code>
* $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)));
* </code>
*
* @return \Doctrine\ORM\Query\Expr
*/ */
public function getExpressionBuilder() public function getExpressionBuilder()
{ {
@ -208,9 +195,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Starts a transaction on the underlying database connection. * {@inheritDoc}
*
* @return void
*/ */
public function beginTransaction() public function beginTransaction()
{ {
@ -218,18 +203,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Executes a function in a transaction. * {@inheritDoc}
*
* 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.
*
* @param callable $func The function to execute transactionally.
*
* @return mixed The non-empty value returned from the closure or true instead.
*/ */
public function transactional($func) public function transactional($func)
{ {
@ -255,9 +229,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Commits a transaction on the underlying database connection. * {@inheritDoc}
*
* @return void
*/ */
public function commit() public function commit()
{ {
@ -265,9 +237,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Performs a rollback on the underlying database connection. * {@inheritDoc}
*
* @return void
*/ */
public function rollback() public function rollback()
{ {
@ -296,11 +266,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Creates a new Query object. * {@inheritDoc}
*
* @param string $dql The DQL string.
*
* @return \Doctrine\ORM\Query
*/ */
public function createQuery($dql = '') public function createQuery($dql = '')
{ {
@ -314,11 +280,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Creates a Query from a named query. * {@inheritDoc}
*
* @param string $name
*
* @return \Doctrine\ORM\Query
*/ */
public function createNamedQuery($name) public function createNamedQuery($name)
{ {
@ -326,12 +288,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Creates a native SQL query. * {@inheritDoc}
*
* @param string $sql
* @param ResultSetMapping $rsm The ResultSetMapping to use.
*
* @return NativeQuery
*/ */
public function createNativeQuery($sql, ResultSetMapping $rsm) public function createNativeQuery($sql, ResultSetMapping $rsm)
{ {
@ -344,11 +301,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Creates a NativeQuery from a named native query. * {@inheritDoc}
*
* @param string $name
*
* @return \Doctrine\ORM\NativeQuery
*/ */
public function createNamedNativeQuery($name) public function createNamedNativeQuery($name)
{ {
@ -358,9 +311,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Create a QueryBuilder instance * {@inheritDoc}
*
* @return QueryBuilder
*/ */
public function createQueryBuilder() public function createQueryBuilder()
{ {
@ -480,15 +431,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets a reference to the entity identified by the given type and identifier * {@inheritDoc}
* without actually loading it, if the entity is not yet loaded.
*
* @param string $entityName The name of the entity type.
* @param mixed $id The entity identifier.
*
* @return object The entity reference.
*
* @throws ORMException
*/ */
public function getReference($entityName, $id) public function getReference($entityName, $id)
{ {
@ -529,24 +472,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets a partial reference to the entity identified by the given type and identifier * {@inheritDoc}
* without actually loading it, if the entity is not yet loaded.
*
* 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.
*
* @param string $entityName The name of the entity type.
* @param mixed $identifier The entity identifier.
*
* @return object The (partial) entity reference.
*/ */
public function getPartialReference($entityName, $identifier) public function getPartialReference($entityName, $identifier)
{ {
@ -585,11 +511,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Closes the EntityManager. All entities that are currently managed * {@inheritDoc}
* by this EntityManager become detached. The EntityManager may no longer
* be used after it is closed.
*
* @return void
*/ */
public function close() public function close()
{ {
@ -713,14 +635,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Creates a copy of the given entity. Can create a shallow or a deep copy. * {@inheritDoc}
*
* @param object $entity The entity to copy.
* @param boolean $deep FALSE for a shallow copy, TRUE for a deep copy.
*
* @return object The new entity.
*
* @throws \BadMethodCallException
* *
* @todo Implementation need. This is necessary since $e2 = clone $e1; throws an E_FATAL when access anything on $e: * @todo Implementation need. This is necessary since $e2 = clone $e1; throws an E_FATAL when access anything on $e:
* Fatal error: Maximum function nesting level of '100' reached, aborting! * Fatal error: Maximum function nesting level of '100' reached, aborting!
@ -731,16 +646,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Acquire a lock on the given entity. * {@inheritDoc}
*
* @param object $entity
* @param int $lockMode
* @param int|null $lockVersion
*
* @return void
*
* @throws OptimisticLockException
* @throws PessimisticLockException
*/ */
public function lock($entity, $lockMode, $lockVersion = null) public function lock($entity, $lockMode, $lockVersion = null)
{ {
@ -774,9 +680,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets the EventManager used by the EntityManager. * {@inheritDoc}
*
* @return \Doctrine\Common\EventManager
*/ */
public function getEventManager() public function getEventManager()
{ {
@ -784,9 +688,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets the Configuration used by the EntityManager. * {@inheritDoc}
*
* @return \Doctrine\ORM\Configuration
*/ */
public function getConfiguration() public function getConfiguration()
{ {
@ -808,9 +710,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Check if the Entity manager is open or closed. * {@inheritDoc}
*
* @return bool
*/ */
public function isOpen() public function isOpen()
{ {
@ -818,9 +718,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets the UnitOfWork used by the EntityManager to coordinate operations. * {@inheritDoc}
*
* @return \Doctrine\ORM\UnitOfWork
*/ */
public function getUnitOfWork() public function getUnitOfWork()
{ {
@ -828,16 +726,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets a hydrator for the given hydration mode. * {@inheritDoc}
*
* This method caches the hydrator instances which is used for all queries that don't
* selectively iterate over the result.
*
* @deprecated
*
* @param int $hydrationMode
*
* @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*/ */
public function getHydrator($hydrationMode) public function getHydrator($hydrationMode)
{ {
@ -845,13 +734,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Create a new instance for the given hydration mode. * {@inheritDoc}
*
* @param int $hydrationMode
*
* @return \Doctrine\ORM\Internal\Hydration\AbstractHydrator
*
* @throws ORMException
*/ */
public function newHydrator($hydrationMode) public function newHydrator($hydrationMode)
{ {
@ -881,9 +764,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets the proxy factory used by the EntityManager to create entity proxies. * {@inheritDoc}
*
* @return ProxyFactory
*/ */
public function getProxyFactory() public function getProxyFactory()
{ {
@ -891,13 +772,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Helper method to initialize a lazy loading proxy or persistent collection. * {@inheritDoc}
*
* This method is a no-op for other objects
*
* @param object $obj
*
* @return void
*/ */
public function initializeObject($obj) public function initializeObject($obj)
{ {
@ -943,9 +818,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Gets the enabled filters. * {@inheritDoc}
*
* @return FilterCollection The active filter collection.
*/ */
public function getFilters() public function getFilters()
{ {
@ -957,9 +830,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Checks whether the state of the filter collection is clean. * {@inheritDoc}
*
* @return boolean True, if the filter collection is clean.
*/ */
public function isFiltersStateClean() public function isFiltersStateClean()
{ {
@ -967,9 +838,7 @@ use Doctrine\Common\Util\ClassUtils;
} }
/** /**
* Checks whether the Entity Manager has filters. * {@inheritDoc}
*
* @return boolean True, if the EM has a filter collection.
*/ */
public function hasFilters() public function hasFilters()
{ {