From 43d94e7b5e62fd17f8424ad335a1626394c6d384 Mon Sep 17 00:00:00 2001 From: Tim Lieberman Date: Fri, 31 Jan 2014 15:32:31 -0800 Subject: [PATCH 1/3] Console EntityManagerHelper now accepts EntityManagerInterface as constructor argument, instead of insisting on an EntityManager --- lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php b/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php index 942033fdb..a0f78fb06 100644 --- a/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php +++ b/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php @@ -37,7 +37,7 @@ class EntityManagerHelper extends Helper /** * Doctrine ORM EntityManager. * - * @var EntityManager + * @var EntityManagerInterface */ protected $_em; @@ -46,7 +46,7 @@ class EntityManagerHelper extends Helper * * @param \Doctrine\ORM\EntityManager $em */ - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->_em = $em; } From bf9fbd896b7649ff9d6d35c40b8268f963be352b Mon Sep 17 00:00:00 2001 From: Tim Lieberman Date: Sat, 1 Feb 2014 00:23:23 +0000 Subject: [PATCH 2/3] Substitute EntityManagerInterface for EntityManager in Console EntityManagerHelper --- .../ORM/Tools/Console/Helper/EntityManagerHelper.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php b/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php index a0f78fb06..2092294fc 100644 --- a/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php +++ b/lib/Doctrine/ORM/Tools/Console/Helper/EntityManagerHelper.php @@ -19,8 +19,9 @@ namespace Doctrine\ORM\Tools\Console\Helper; +use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Helper\Helper; -use Doctrine\ORM\EntityManager; + /** * Doctrine CLI Connection Helper. @@ -35,7 +36,7 @@ use Doctrine\ORM\EntityManager; class EntityManagerHelper extends Helper { /** - * Doctrine ORM EntityManager. + * Doctrine ORM EntityManagerInterface. * * @var EntityManagerInterface */ @@ -44,7 +45,7 @@ class EntityManagerHelper extends Helper /** * Constructor. * - * @param \Doctrine\ORM\EntityManager $em + * @param EntityManagerInterface $em */ public function __construct(EntityManagerInterface $em) { @@ -54,7 +55,7 @@ class EntityManagerHelper extends Helper /** * Retrieves Doctrine ORM EntityManager. * - * @return EntityManager + * @return EntityManagerInterface */ public function getEntityManager() { From 25d71462e37c955045757381294b797503284568 Mon Sep 17 00:00:00 2001 From: Tim Lieberman Date: Sat, 1 Feb 2014 05:11:20 +0000 Subject: [PATCH 3/3] Make SchemaTool and SchemaValidator use EntityManagerInterface instead of EntityManager --- lib/Doctrine/ORM/Tools/SchemaTool.php | 8 ++++---- lib/Doctrine/ORM/Tools/SchemaValidator.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 21140f7a0..2f90ad761 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -26,7 +26,7 @@ use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector; use Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Internal\CommitOrderCalculator; use Doctrine\ORM\Tools\Event\GenerateSchemaTableEventArgs; @@ -47,7 +47,7 @@ use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; class SchemaTool { /** - * @var \Doctrine\ORM\EntityManager + * @var \Doctrine\ORM\EntityManagerInterface */ private $em; @@ -67,9 +67,9 @@ class SchemaTool * Initializes a new SchemaTool instance that uses the connection of the * provided EntityManager. * - * @param \Doctrine\ORM\EntityManager $em + * @param \Doctrine\ORM\EntityManagerInterface $em */ - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; $this->platform = $em->getConnection()->getDatabasePlatform(); diff --git a/lib/Doctrine/ORM/Tools/SchemaValidator.php b/lib/Doctrine/ORM/Tools/SchemaValidator.php index 11910138e..59b65ebc1 100644 --- a/lib/Doctrine/ORM/Tools/SchemaValidator.php +++ b/lib/Doctrine/ORM/Tools/SchemaValidator.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Tools; -use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\DBAL\Types\Type; @@ -37,14 +37,14 @@ use Doctrine\DBAL\Types\Type; class SchemaValidator { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em; /** - * @param EntityManager $em + * @param EntityManagerInterface $em */ - public function __construct(EntityManager $em) + public function __construct(EntityManagerInterface $em) { $this->em = $em; }