1
0
mirror of synced 2024-12-05 03:06:05 +03:00

DDC-3427 - s/EntityManager/EntityManagerInterface in type-hints

This commit is contained in:
Marco Pivetta 2014-12-05 14:02:47 +01:00
parent 0e7646cf4b
commit 6fc0d84b7a
23 changed files with 105 additions and 126 deletions

View File

@ -87,7 +87,7 @@ abstract class AbstractQuery
/** /**
* The entity manager used by this query object. * The entity manager used by this query object.
* *
* @var \Doctrine\ORM\EntityManager * @var EntityManagerInterface
*/ */
protected $_em; protected $_em;
@ -161,9 +161,9 @@ abstract class AbstractQuery
/** /**
* Initializes a new instance of a class derived from <tt>AbstractQuery</tt>. * Initializes a new instance of a class derived from <tt>AbstractQuery</tt>.
* *
* @param \Doctrine\ORM\EntityManager $em * @param \Doctrine\ORM\EntityManagerInterface $em
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->_em = $em; $this->_em = $em;
$this->parameters = new ArrayCollection(); $this->parameters = new ArrayCollection();

View File

@ -19,9 +19,9 @@
namespace Doctrine\ORM\Event; namespace Doctrine\ORM\Event;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\EntityManager;
use Doctrine\Common\EventArgs; use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata;
/** /**
* A method invoker based on entity lifecycle. * A method invoker based on entity lifecycle.
@ -51,9 +51,9 @@ class ListenersInvoker
/** /**
* Initializes a new ListenersInvoker instance. * Initializes a new ListenersInvoker instance.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->eventManager = $em->getEventManager(); $this->eventManager = $em->getEventManager();
$this->resolver = $em->getConfiguration()->getEntityListenerResolver(); $this->resolver = $em->getConfiguration()->getEntityListenerResolver();

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Event; namespace Doctrine\ORM\Event;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Provides event arguments for the onClear event. * Provides event arguments for the onClear event.
@ -33,7 +33,7 @@ use Doctrine\ORM\EntityManager;
class OnClearEventArgs extends \Doctrine\Common\EventArgs class OnClearEventArgs extends \Doctrine\Common\EventArgs
{ {
/** /**
* @var \Doctrine\ORM\EntityManager * @var EntityManagerInterface
*/ */
private $em; private $em;
@ -45,10 +45,10 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs
/** /**
* Constructor. * Constructor.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
* @param string|null $entityClass Optional entity class. * @param string|null $entityClass Optional entity class.
*/ */
public function __construct(EntityManager $em, $entityClass = null) public function __construct(EntityManagerInterface $em, $entityClass = null)
{ {
$this->em = $em; $this->em = $em;
$this->entityClass = $entityClass; $this->entityClass = $entityClass;

View File

@ -20,7 +20,7 @@
namespace Doctrine\ORM\Event; namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs; use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Provides event arguments for the preFlush event. * Provides event arguments for the preFlush event.
@ -34,16 +34,16 @@ use Doctrine\ORM\EntityManager;
class OnFlushEventArgs extends EventArgs class OnFlushEventArgs extends EventArgs
{ {
/** /**
* @var \Doctrine\ORM\EntityManager * @var EntityManagerInterface
*/ */
private $em; private $em;
/** /**
* Constructor. * Constructor.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->em = $em; $this->em = $em;
} }

View File

@ -18,8 +18,8 @@
*/ */
namespace Doctrine\ORM\Event; namespace Doctrine\ORM\Event;
use Doctrine\ORM\EntityManager;
use Doctrine\Common\EventArgs; use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManagerInterface;
/** /**
* Provides event arguments for the postFlush event. * Provides event arguments for the postFlush event.
@ -39,9 +39,9 @@ class PostFlushEventArgs extends EventArgs
/** /**
* Constructor. * Constructor.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->em = $em; $this->em = $em;
} }

View File

@ -20,7 +20,7 @@
namespace Doctrine\ORM\Event; namespace Doctrine\ORM\Event;
use Doctrine\Common\EventArgs; use Doctrine\Common\EventArgs;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Provides event arguments for the preFlush event. * Provides event arguments for the preFlush event.
@ -41,9 +41,9 @@ class PreFlushEventArgs extends EventArgs
/** /**
* Constructor. * Constructor.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->em = $em; $this->em = $em;
} }

View File

@ -19,19 +19,19 @@
namespace Doctrine\ORM\Id; namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
abstract class AbstractIdGenerator abstract class AbstractIdGenerator
{ {
/** /**
* Generates an identifier for an entity. * Generates an identifier for an entity.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
* @param \Doctrine\ORM\Mapping\Entity $entity * @param \Doctrine\ORM\Mapping\Entity $entity
* *
* @return mixed * @return mixed
*/ */
abstract public function generate(EntityManager $em, $entity); abstract public function generate(EntityManagerInterface $em, $entity);
/** /**
* Gets whether this generator is a post-insert generator which means that * Gets whether this generator is a post-insert generator which means that

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Id; namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\ORMException; use Doctrine\ORM\ORMException;
/** /**
@ -36,16 +36,11 @@ class AssignedGenerator extends AbstractIdGenerator
/** /**
* Returns the identifier assigned to the given entity. * Returns the identifier assigned to the given entity.
* *
* @param EntityManager $em * {@inheritDoc}
* @param object $entity
*
* @return mixed
* *
* @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\ORMException
*
* @override
*/ */
public function generate(EntityManager $em, $entity) public function generate(EntityManagerInterface $em, $entity)
{ {
$class = $em->getClassMetadata(get_class($entity)); $class = $em->getClassMetadata(get_class($entity));
$idFields = $class->getIdentifierFieldNames(); $idFields = $class->getIdentifierFieldNames();

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Id; namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Id generator that obtains IDs from special "identity" columns. These are columns * Id generator that obtains IDs from special "identity" columns. These are columns
@ -48,15 +48,15 @@ class BigIntegerIdentityGenerator extends AbstractIdGenerator
} }
/** /**
* {@inheritdoc} * {@inheritDoc}
*/ */
public function generate(EntityManager $em, $entity) public function generate(EntityManagerInterface $em, $entity)
{ {
return (string)$em->getConnection()->lastInsertId($this->sequenceName); return (string) $em->getConnection()->lastInsertId($this->sequenceName);
} }
/** /**
* {@inheritdoc} * {@inheritDoc}
*/ */
public function isPostInsertGenerator() public function isPostInsertGenerator()
{ {

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Id; namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Id generator that obtains IDs from special "identity" columns. These are columns * Id generator that obtains IDs from special "identity" columns. These are columns
@ -48,9 +48,9 @@ class IdentityGenerator extends AbstractIdGenerator
} }
/** /**
* {@inheritdoc} * {@inheritDoc}
*/ */
public function generate(EntityManager $em, $entity) public function generate(EntityManagerInterface $em, $entity)
{ {
return (int)$em->getConnection()->lastInsertId($this->sequenceName); return (int)$em->getConnection()->lastInsertId($this->sequenceName);
} }

View File

@ -19,8 +19,8 @@
namespace Doctrine\ORM\Id; namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManagerInterface;
use Serializable; use Serializable;
use Doctrine\ORM\EntityManager;
/** /**
* Represents an ID generator that uses a database sequence. * Represents an ID generator that uses a database sequence.
@ -67,16 +67,9 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable
} }
/** /**
* Generates an ID for the given entity. * {@inheritDoc}
*
* @param EntityManager $em
* @param object $entity
*
* @return integer The generated value.
*
* @override
*/ */
public function generate(EntityManager $em, $entity) public function generate(EntityManagerInterface $em, $entity)
{ {
if ($this->_maxValue === null || $this->_nextValue == $this->_maxValue) { if ($this->_maxValue === null || $this->_nextValue == $this->_maxValue) {
// Allocate new values // Allocate new values

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Id; namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Id generator that uses a single-row database table and a hi/lo algorithm. * Id generator that uses a single-row database table and a hi/lo algorithm.
@ -70,9 +70,9 @@ class TableGenerator extends AbstractIdGenerator
} }
/** /**
* {@inheritdoc} * {@inheritDoc}
*/ */
public function generate(EntityManager $em, $entity) public function generate(EntityManagerInterface $em, $entity)
{ {
if ($this->_maxValue === null || $this->_nextValue == $this->_maxValue) { if ($this->_maxValue === null || $this->_nextValue == $this->_maxValue) {
// Allocate new values // Allocate new values

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Id; namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Represents an ID generator that uses the database UUID expression * Represents an ID generator that uses the database UUID expression
@ -30,16 +30,9 @@ use Doctrine\ORM\EntityManager;
class UuidGenerator extends AbstractIdGenerator class UuidGenerator extends AbstractIdGenerator
{ {
/** /**
* Generates an ID for the given entity. * {@inheritDoc}
*
* @param EntityManager $em The EntityManager to use.
* @param object $entity
*
* @return string The generated value.
*
* @override
*/ */
public function generate(EntityManager $em, $entity) public function generate(EntityManagerInterface $em, $entity)
{ {
$conn = $em->getConnection(); $conn = $em->getConnection();
$sql = 'SELECT ' . $conn->getDatabasePlatform()->getGuidExpression(); $sql = 'SELECT ' . $conn->getDatabasePlatform()->getGuidExpression();

View File

@ -19,11 +19,11 @@
namespace Doctrine\ORM\Internal\Hydration; namespace Doctrine\ORM\Internal\Hydration;
use PDO;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Events; use Doctrine\ORM\Events;
use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadata;
use PDO;
/** /**
* Base class for all hydrators. A hydrator is a class that provides some form * Base class for all hydrators. A hydrator is a class that provides some form
@ -46,7 +46,7 @@ abstract class AbstractHydrator
/** /**
* The EntityManager instance. * The EntityManager instance.
* *
* @var EntityManager * @var EntityManagerInterface
*/ */
protected $_em; protected $_em;
@ -95,9 +95,9 @@ abstract class AbstractHydrator
/** /**
* Initializes a new instance of a class derived from <tt>AbstractHydrator</tt>. * Initializes a new instance of a class derived from <tt>AbstractHydrator</tt>.
* *
* @param \Doctrine\ORM\EntityManager $em The EntityManager to use. * @param EntityManagerInterface $em The EntityManager to use.
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->_em = $em; $this->_em = $em;
$this->_platform = $em->getConnection()->getDatabasePlatform(); $this->_platform = $em->getConnection()->getDatabasePlatform();

View File

@ -71,7 +71,7 @@ final class PersistentCollection implements Collection, Selectable
/** /**
* The EntityManager that manages the persistence of the collection. * The EntityManager that manages the persistence of the collection.
* *
* @var \Doctrine\ORM\EntityManager * @var \Doctrine\ORM\EntityManagerInterface
*/ */
private $em; private $em;
@ -115,11 +115,11 @@ final class PersistentCollection implements Collection, Selectable
/** /**
* Creates a new persistent collection. * Creates a new persistent collection.
* *
* @param EntityManager $em The EntityManager the collection will be associated with. * @param EntityManagerInterface $em The EntityManager the collection will be associated with.
* @param ClassMetadata $class The class descriptor of the entity type of this collection. * @param ClassMetadata $class The class descriptor of the entity type of this collection.
* @param Collection $coll The collection elements. * @param Collection $coll The collection elements.
*/ */
public function __construct(EntityManager $em, $class, $coll) public function __construct(EntityManagerInterface $em, $class, $coll)
{ {
$this->coll = $coll; $this->coll = $coll;
$this->em = $em; $this->em = $em;

View File

@ -19,25 +19,23 @@
namespace Doctrine\ORM\Persisters\Entity; namespace Doctrine\ORM\Persisters\Entity;
use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\ORMException;
use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\UnitOfWork;
use Doctrine\ORM\Query;
use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Persisters\SqlExpressionVisitor;
use Doctrine\ORM\Persisters\SqlValueVisitor;
use Doctrine\ORM\Utility\IdentifierFlattener;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Expr\Comparison; use Doctrine\Common\Collections\Expr\Comparison;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\Persisters\SqlExpressionVisitor;
use Doctrine\ORM\Persisters\SqlValueVisitor;
use Doctrine\ORM\Query;
use Doctrine\ORM\UnitOfWork;
use Doctrine\ORM\Utility\IdentifierFlattener;
/** /**
* A BasicEntityPersister maps an entity to a single table in a relational database. * A BasicEntityPersister maps an entity to a single table in a relational database.
@ -124,7 +122,7 @@ class BasicEntityPersister implements EntityPersister
/** /**
* The EntityManager instance. * The EntityManager instance.
* *
* @var \Doctrine\ORM\EntityManager * @var EntityManagerInterface
*/ */
protected $em; protected $em;
@ -221,10 +219,10 @@ class BasicEntityPersister implements EntityPersister
* Initializes a new <tt>BasicEntityPersister</tt> that uses the given EntityManager * Initializes a new <tt>BasicEntityPersister</tt> that uses the given EntityManager
* and persists instances of the class described by the given ClassMetadata descriptor. * and persists instances of the class described by the given ClassMetadata descriptor.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
* @param \Doctrine\ORM\Mapping\ClassMetadata $class * @param ClassMetadata $class
*/ */
public function __construct(EntityManager $em, ClassMetadata $class) public function __construct(EntityManagerInterface $em, ClassMetadata $class)
{ {
$this->em = $em; $this->em = $em;
$this->class = $class; $this->class = $class;

View File

@ -21,12 +21,12 @@ namespace Doctrine\ORM\Proxy;
use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\Proxy\AbstractProxyFactory; use Doctrine\Common\Proxy\AbstractProxyFactory;
use Doctrine\Common\Proxy\ProxyDefinition;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\Common\Proxy\Proxy as BaseProxy; use Doctrine\Common\Proxy\Proxy as BaseProxy;
use Doctrine\Common\Proxy\ProxyDefinition;
use Doctrine\Common\Proxy\ProxyGenerator; use Doctrine\Common\Proxy\ProxyGenerator;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Persisters\Entity\EntityPersister; use Doctrine\ORM\Persisters\Entity\EntityPersister;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityNotFoundException; use Doctrine\ORM\EntityNotFoundException;
use Doctrine\ORM\Utility\IdentifierFlattener; use Doctrine\ORM\Utility\IdentifierFlattener;
@ -41,7 +41,7 @@ use Doctrine\ORM\Utility\IdentifierFlattener;
class ProxyFactory extends AbstractProxyFactory class ProxyFactory extends AbstractProxyFactory
{ {
/** /**
* @var \Doctrine\ORM\EntityManager The EntityManager this factory is bound to. * @var EntityManagerInterface The EntityManager this factory is bound to.
*/ */
private $em; private $em;
@ -66,13 +66,13 @@ class ProxyFactory extends AbstractProxyFactory
* Initializes a new instance of the <tt>ProxyFactory</tt> class that is * Initializes a new instance of the <tt>ProxyFactory</tt> class that is
* connected to the given <tt>EntityManager</tt>. * connected to the given <tt>EntityManager</tt>.
* *
* @param \Doctrine\ORM\EntityManager $em The EntityManager the new factory works for. * @param EntityManagerInterface $em The EntityManager the new factory works for.
* @param string $proxyDir The directory to use for the proxy classes. It must exist. * @param string $proxyDir The directory to use for the proxy classes. It must exist.
* @param string $proxyNs The namespace to use for the proxy classes. * @param string $proxyNs The namespace to use for the proxy classes.
* @param boolean|int $autoGenerate The strategy for automatically generating proxy classes. Possible * @param boolean|int $autoGenerate The strategy for automatically generating proxy classes. Possible
* values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. * values are constants of Doctrine\Common\Proxy\AbstractProxyFactory.
*/ */
public function __construct(EntityManager $em, $proxyDir, $proxyNs, $autoGenerate = AbstractProxyFactory::AUTOGENERATE_NEVER) public function __construct(EntityManagerInterface $em, $proxyDir, $proxyNs, $autoGenerate = AbstractProxyFactory::AUTOGENERATE_NEVER)
{ {
$proxyGenerator = new ProxyGenerator($proxyDir, $proxyNs); $proxyGenerator = new ProxyGenerator($proxyDir, $proxyNs);

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Query\Filter; namespace Doctrine\ORM\Query\Filter;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query\ParameterTypeInferer; use Doctrine\ORM\Query\ParameterTypeInferer;
@ -37,7 +37,7 @@ abstract class SQLFilter
/** /**
* The entity manager. * The entity manager.
* *
* @var EntityManager * @var EntityManagerInterface
*/ */
private $em; private $em;
@ -51,9 +51,9 @@ abstract class SQLFilter
/** /**
* Constructs the SQLFilter object. * Constructs the SQLFilter object.
* *
* @param EntityManager $em The entity manager. * @param EntityManagerInterface $em The entity manager.
*/ */
final public function __construct(EntityManager $em) final public function __construct(EntityManagerInterface $em)
{ {
$this->em = $em; $this->em = $em;
} }

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Query; namespace Doctrine\ORM\Query;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
/** /**
* Collection class for all the query filters. * Collection class for all the query filters.
@ -74,9 +74,9 @@ class FilterCollection
/** /**
* Constructor. * Constructor.
* *
* @param EntityManager $em * @param EntityManagerInterface $em
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->em = $em; $this->em = $em;
$this->config = $em->getConfiguration(); $this->config = $em->getConfiguration();

View File

@ -19,7 +19,7 @@
namespace Doctrine\ORM\Query; namespace Doctrine\ORM\Query;
use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\ClassMetadataInfo;
/** /**
@ -64,7 +64,7 @@ class ResultSetMappingBuilder extends ResultSetMapping
private $sqlCounter = 0; private $sqlCounter = 0;
/** /**
* @var EntityManager * @var EntityManagerInterface
*/ */
private $em; private $em;
@ -76,10 +76,10 @@ class ResultSetMappingBuilder extends ResultSetMapping
private $defaultRenameMode; private $defaultRenameMode;
/** /**
* @param EntityManager $em * @param EntityManagerInterface $em
* @param integer $defaultRenameMode * @param integer $defaultRenameMode
*/ */
public function __construct(EntityManager $em, $defaultRenameMode = self::COLUMN_RENAMING_NONE) public function __construct(EntityManagerInterface $em, $defaultRenameMode = self::COLUMN_RENAMING_NONE)
{ {
$this->em = $em; $this->em = $em;
$this->defaultRenameMode = $defaultRenameMode; $this->defaultRenameMode = $defaultRenameMode;

View File

@ -48,7 +48,7 @@ class QueryBuilder
/** /**
* The EntityManager used by this QueryBuilder. * The EntityManager used by this QueryBuilder.
* *
* @var EntityManager * @var EntityManagerInterface
*/ */
private $_em; private $_em;
@ -147,9 +147,9 @@ class QueryBuilder
/** /**
* Initializes a new <tt>QueryBuilder</tt> that uses the given <tt>EntityManager</tt>. * Initializes a new <tt>QueryBuilder</tt> that uses the given <tt>EntityManager</tt>.
* *
* @param EntityManager $em The EntityManager to use. * @param EntityManagerInterface $em The EntityManager to use.
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->_em = $em; $this->_em = $em;
$this->parameters = new ArrayCollection(); $this->parameters = new ArrayCollection();

View File

@ -20,11 +20,11 @@
namespace Doctrine\ORM\Tools; namespace Doctrine\ORM\Tools;
use Doctrine\Common\Persistence\Proxy; use Doctrine\Common\Persistence\Proxy;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\OnFlushEventArgs; use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\PersistentCollection; use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\UnitOfWork; use Doctrine\ORM\UnitOfWork;
use Doctrine\ORM\EntityManager;
/** /**
* Use this logger to dump the identity map during the onFlush event. This is useful for debugging * Use this logger to dump the identity map during the onFlush event. This is useful for debugging
@ -69,11 +69,11 @@ class DebugUnitOfWorkListener
/** /**
* Dumps the contents of the identity map into a stream. * Dumps the contents of the identity map into a stream.
* *
* @param EntityManager $em * @param EntityManagerInterface $em
* *
* @return void * @return void
*/ */
public function dumpIdentityMap(EntityManager $em) public function dumpIdentityMap(EntityManagerInterface $em)
{ {
$uow = $em->getUnitOfWork(); $uow = $em->getUnitOfWork();
$identityMap = $uow->getIdentityMap(); $identityMap = $uow->getIdentityMap();

View File

@ -204,7 +204,7 @@ class UnitOfWork implements PropertyChangedListener
/** /**
* The EntityManager that "owns" this UnitOfWork instance. * The EntityManager that "owns" this UnitOfWork instance.
* *
* @var \Doctrine\ORM\EntityManager * @var EntityManagerInterface
*/ */
private $em; private $em;
@ -287,9 +287,9 @@ class UnitOfWork implements PropertyChangedListener
/** /**
* Initializes a new UnitOfWork instance, bound to the given EntityManager. * Initializes a new UnitOfWork instance, bound to the given EntityManager.
* *
* @param \Doctrine\ORM\EntityManager $em * @param EntityManagerInterface $em
*/ */
public function __construct(EntityManager $em) public function __construct(EntityManagerInterface $em)
{ {
$this->em = $em; $this->em = $em;
$this->evm = $em->getEventManager(); $this->evm = $em->getEventManager();