From f90475772d0b9dbf9851dc88617c28fc62046c6a Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Thu, 15 Jan 2015 05:01:52 +0000 Subject: [PATCH] Classify persisters into more granular namespaces. --- lib/Doctrine/ORM/Cache/CacheFactory.php | 21 +++++----- .../ORM/Cache/DefaultCacheFactory.php | 16 ++++---- .../AbstractCollectionPersister.php | 14 +++---- .../CachedCollectionPersister.php | 5 ++- ...rictReadWriteCachedCollectionPersister.php | 2 +- .../ReadOnlyCachedCollectionPersister.php | 2 +- .../ReadWriteCachedCollectionPersister.php | 13 +++---- .../{ => Entity}/AbstractEntityPersister.php | 15 ++++---- .../{ => Entity}/CachedEntityPersister.php | 5 ++- ...onStrictReadWriteCachedEntityPersister.php | 2 +- .../ReadOnlyCachedEntityPersister.php | 2 +- .../ReadWriteCachedEntityPersister.php | 13 +++---- lib/Doctrine/ORM/LazyCriteriaCollection.php | 4 +- .../AbstractCollectionPersister.php | 2 +- .../{ => Collection}/CollectionPersister.php | 2 +- .../{ => Collection}/ManyToManyPersister.php | 4 +- .../{ => Collection}/OneToManyPersister.php | 3 +- .../AbstractEntityInheritancePersister.php | 2 +- .../{ => Entity}/BasicEntityPersister.php | 4 +- .../{ => Entity}/EntityPersister.php | 2 +- .../{ => Entity}/JoinedSubclassPersister.php | 2 +- .../{ => Entity}/SingleTablePersister.php | 2 +- .../ORM/Persisters/SqlExpressionVisitor.php | 6 ++- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 6 +-- lib/Doctrine/ORM/UnitOfWork.php | 14 +++---- .../Tests/Mocks/EntityPersisterMock.php | 3 +- tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php | 4 +- .../ORM/Cache/DefaultCacheFactoryTest.php | 38 +++++++++---------- .../AbstractCollectionPersisterTest.php | 22 +++++------ ...ReadWriteCachedCollectionPersisterTest.php | 8 ++-- .../ReadOnlyCachedCollectionPersisterTest.php | 8 ++-- ...ReadWriteCachedCollectionPersisterTest.php | 20 +++++----- .../AbstractEntityPersisterTest.php | 22 +++++------ ...rictReadWriteCachedEntityPersisterTest.php | 16 ++++---- .../ReadOnlyCachedEntityPersisterTest.php | 8 ++-- .../ReadWriteCachedEntityPersisterTest.php | 16 ++++---- .../SecondLevelCacheOneToManyTest.php | 10 ++--- .../Tests/ORM/LazyCriteriaCollectionTest.php | 4 +- .../ORM/Performance/ProxyPerformanceTest.php | 4 +- .../BasicEntityPersisterTypeValueSqlTest.php | 3 +- .../JoinedSubclassPersisterTest.php | 6 +-- .../Tests/ORM/Proxy/ProxyFactoryTest.php | 6 +-- 42 files changed, 183 insertions(+), 178 deletions(-) rename lib/Doctrine/ORM/Cache/Persister/{ => Collection}/AbstractCollectionPersister.php (92%) rename lib/Doctrine/ORM/Cache/Persister/{ => Collection}/CachedCollectionPersister.php (93%) rename lib/Doctrine/ORM/Cache/Persister/{ => Collection}/NonStrictReadWriteCachedCollectionPersister.php (98%) rename lib/Doctrine/ORM/Cache/Persister/{ => Collection}/ReadOnlyCachedCollectionPersister.php (97%) rename lib/Doctrine/ORM/Cache/Persister/{ => Collection}/ReadWriteCachedCollectionPersister.php (87%) rename lib/Doctrine/ORM/Cache/Persister/{ => Entity}/AbstractEntityPersister.php (96%) rename lib/Doctrine/ORM/Cache/Persister/{ => Entity}/CachedEntityPersister.php (91%) rename lib/Doctrine/ORM/Cache/Persister/{ => Entity}/NonStrictReadWriteCachedEntityPersister.php (98%) rename lib/Doctrine/ORM/Cache/Persister/{ => Entity}/ReadOnlyCachedEntityPersister.php (96%) rename lib/Doctrine/ORM/Cache/Persister/{ => Entity}/ReadWriteCachedEntityPersister.php (88%) rename lib/Doctrine/ORM/Persisters/{ => Collection}/AbstractCollectionPersister.php (98%) rename lib/Doctrine/ORM/Persisters/{ => Collection}/CollectionPersister.php (98%) rename lib/Doctrine/ORM/Persisters/{ => Collection}/ManyToManyPersister.php (99%) rename lib/Doctrine/ORM/Persisters/{ => Collection}/OneToManyPersister.php (98%) rename lib/Doctrine/ORM/Persisters/{ => Entity}/AbstractEntityInheritancePersister.php (98%) rename lib/Doctrine/ORM/Persisters/{ => Entity}/BasicEntityPersister.php (99%) rename lib/Doctrine/ORM/Persisters/{ => Entity}/EntityPersister.php (99%) rename lib/Doctrine/ORM/Persisters/{ => Entity}/JoinedSubclassPersister.php (99%) rename lib/Doctrine/ORM/Persisters/{ => Entity}/SingleTablePersister.php (99%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Collection}/AbstractCollectionPersisterTest.php (90%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Collection}/NonStrictReadWriteCachedCollectionPersisterTest.php (69%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Collection}/ReadOnlyCachedCollectionPersisterTest.php (69%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Collection}/ReadWriteCachedCollectionPersisterTest.php (94%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Entity}/AbstractEntityPersisterTest.php (94%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Entity}/NonStrictReadWriteCachedEntityPersisterTest.php (90%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Entity}/ReadOnlyCachedEntityPersisterTest.php (83%) rename tests/Doctrine/Tests/ORM/Cache/Persister/{ => Entity}/ReadWriteCachedEntityPersisterTest.php (94%) diff --git a/lib/Doctrine/ORM/Cache/CacheFactory.php b/lib/Doctrine/ORM/Cache/CacheFactory.php index 793392199..b91510062 100644 --- a/lib/Doctrine/ORM/Cache/CacheFactory.php +++ b/lib/Doctrine/ORM/Cache/CacheFactory.php @@ -22,9 +22,8 @@ namespace Doctrine\ORM\Cache; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\EntityManagerInterface; - -use Doctrine\ORM\Persisters\CollectionPersister; -use Doctrine\ORM\Persisters\EntityPersister; +use Doctrine\ORM\Persisters\Collection\CollectionPersister; +use Doctrine\ORM\Persisters\Entity\EntityPersister; /** * Contract for building second level cache regions components. @@ -37,22 +36,22 @@ interface CacheFactory /** * Build an entity persister for the given entity metadata. * - * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. - * @param \Doctrine\ORM\Persisters\EntityPersister $persister The entity persister that will be cached. - * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata The entity metadata. + * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. + * @param \Doctrine\ORM\Persisters\Entity\EntityPersister $persister The entity persister that will be cached. + * @param \Doctrine\ORM\Mapping\ClassMetadata $metadata The entity metadata. * - * @return \Doctrine\ORM\Cache\Persister\CachedEntityPersister + * @return \Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister */ public function buildCachedEntityPersister(EntityManagerInterface $em, EntityPersister $persister, ClassMetadata $metadata); /** * Build a collection persister for the given relation mapping. * - * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. - * @param \Doctrine\ORM\Persisters\CollectionPersister $persister The collection persister that will be cached. - * @param array $mapping The association mapping. + * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. + * @param \Doctrine\ORM\Persisters\Collection\CollectionPersister $persister The collection persister that will be cached. + * @param array $mapping The association mapping. * - * @return \Doctrine\ORM\Cache\Persister\CachedCollectionPersister + * @return \Doctrine\ORM\Cache\Persister\Collection\CachedCollectionPersister */ public function buildCachedCollectionPersister(EntityManagerInterface $em, CollectionPersister $persister, array $mapping); diff --git a/lib/Doctrine/ORM/Cache/DefaultCacheFactory.php b/lib/Doctrine/ORM/Cache/DefaultCacheFactory.php index 6e93c6ecf..791718569 100644 --- a/lib/Doctrine/ORM/Cache/DefaultCacheFactory.php +++ b/lib/Doctrine/ORM/Cache/DefaultCacheFactory.php @@ -29,14 +29,14 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Cache\Region\DefaultRegion; use Doctrine\ORM\Cache\Region\FileLockRegion; use Doctrine\ORM\Cache\Region\UpdateTimestampCache; -use Doctrine\ORM\Persisters\EntityPersister; -use Doctrine\ORM\Persisters\CollectionPersister; -use Doctrine\ORM\Cache\Persister\ReadOnlyCachedEntityPersister; -use Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister; -use Doctrine\ORM\Cache\Persister\ReadOnlyCachedCollectionPersister; -use Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister; -use Doctrine\ORM\Cache\Persister\NonStrictReadWriteCachedEntityPersister; -use Doctrine\ORM\Cache\Persister\NonStrictReadWriteCachedCollectionPersister; +use Doctrine\ORM\Persisters\Entity\EntityPersister; +use Doctrine\ORM\Persisters\Collection\CollectionPersister; +use Doctrine\ORM\Cache\Persister\Entity\ReadOnlyCachedEntityPersister; +use Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister; +use Doctrine\ORM\Cache\Persister\Collection\ReadOnlyCachedCollectionPersister; +use Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister; +use Doctrine\ORM\Cache\Persister\Entity\NonStrictReadWriteCachedEntityPersister; +use Doctrine\ORM\Cache\Persister\Collection\NonStrictReadWriteCachedCollectionPersister; /** * @since 2.5 diff --git a/lib/Doctrine/ORM/Cache/Persister/AbstractCollectionPersister.php b/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php similarity index 92% rename from lib/Doctrine/ORM/Cache/Persister/AbstractCollectionPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php index c6b377c07..33d437253 100644 --- a/lib/Doctrine/ORM/Cache/Persister/AbstractCollectionPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php @@ -18,12 +18,12 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Collection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Cache\EntityCacheKey; use Doctrine\ORM\Cache\CollectionCacheKey; -use Doctrine\ORM\Persisters\CollectionPersister; +use Doctrine\ORM\Persisters\Collection\CollectionPersister; use Doctrine\ORM\PersistentCollection; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Cache\Region; @@ -46,7 +46,7 @@ abstract class AbstractCollectionPersister implements CachedCollectionPersister protected $metadataFactory; /** - * @var \Doctrine\ORM\Persisters\CollectionPersister + * @var \Doctrine\ORM\Persisters\Collection\CollectionPersister */ protected $persister; @@ -91,10 +91,10 @@ abstract class AbstractCollectionPersister implements CachedCollectionPersister protected $cacheLogger; /** - * @param \Doctrine\ORM\Persisters\CollectionPersister $persister The collection persister that will be cached. - * @param \Doctrine\ORM\Cache\Region $region The collection region. - * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. - * @param array $association The association mapping. + * @param \Doctrine\ORM\Persisters\Collection\CollectionPersister $persister The collection persister that will be cached. + * @param \Doctrine\ORM\Cache\Region $region The collection region. + * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. + * @param array $association The association mapping. */ public function __construct(CollectionPersister $persister, Region $region, EntityManagerInterface $em, array $association) { diff --git a/lib/Doctrine/ORM/Cache/Persister/CachedCollectionPersister.php b/lib/Doctrine/ORM/Cache/Persister/Collection/CachedCollectionPersister.php similarity index 93% rename from lib/Doctrine/ORM/Cache/Persister/CachedCollectionPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Collection/CachedCollectionPersister.php index 2318c5906..5722027c4 100644 --- a/lib/Doctrine/ORM/Cache/Persister/CachedCollectionPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Collection/CachedCollectionPersister.php @@ -18,10 +18,11 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Collection; use Doctrine\ORM\Cache\CollectionCacheKey; -use Doctrine\ORM\Persisters\CollectionPersister; +use Doctrine\ORM\Cache\Persister\CachedPersister; +use Doctrine\ORM\Persisters\Collection\CollectionPersister; use Doctrine\ORM\PersistentCollection; /** diff --git a/lib/Doctrine/ORM/Cache/Persister/NonStrictReadWriteCachedCollectionPersister.php b/lib/Doctrine/ORM/Cache/Persister/Collection/NonStrictReadWriteCachedCollectionPersister.php similarity index 98% rename from lib/Doctrine/ORM/Cache/Persister/NonStrictReadWriteCachedCollectionPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Collection/NonStrictReadWriteCachedCollectionPersister.php index 8c682762a..86e5c8f9f 100644 --- a/lib/Doctrine/ORM/Cache/Persister/NonStrictReadWriteCachedCollectionPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Collection/NonStrictReadWriteCachedCollectionPersister.php @@ -18,7 +18,7 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Collection; use Doctrine\ORM\Cache\CollectionCacheKey; use Doctrine\ORM\PersistentCollection; diff --git a/lib/Doctrine/ORM/Cache/Persister/ReadOnlyCachedCollectionPersister.php b/lib/Doctrine/ORM/Cache/Persister/Collection/ReadOnlyCachedCollectionPersister.php similarity index 97% rename from lib/Doctrine/ORM/Cache/Persister/ReadOnlyCachedCollectionPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Collection/ReadOnlyCachedCollectionPersister.php index 20890e87d..4f35ceb10 100644 --- a/lib/Doctrine/ORM/Cache/Persister/ReadOnlyCachedCollectionPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Collection/ReadOnlyCachedCollectionPersister.php @@ -18,7 +18,7 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Collection; use Doctrine\ORM\PersistentCollection; use Doctrine\ORM\Cache\CacheException; diff --git a/lib/Doctrine/ORM/Cache/Persister/ReadWriteCachedCollectionPersister.php b/lib/Doctrine/ORM/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php similarity index 87% rename from lib/Doctrine/ORM/Cache/Persister/ReadWriteCachedCollectionPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php index be11531d9..a92ed20d3 100644 --- a/lib/Doctrine/ORM/Cache/Persister/ReadWriteCachedCollectionPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php @@ -18,11 +18,10 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Collection; -use Doctrine\ORM\Persisters\CollectionPersister; +use Doctrine\ORM\Persisters\Collection\CollectionPersister; use Doctrine\ORM\EntityManagerInterface; - use Doctrine\ORM\Cache\CollectionCacheKey; use Doctrine\ORM\Cache\ConcurrentRegion; use Doctrine\ORM\PersistentCollection; @@ -34,10 +33,10 @@ use Doctrine\ORM\PersistentCollection; class ReadWriteCachedCollectionPersister extends AbstractCollectionPersister { /** - * @param \Doctrine\ORM\Persisters\CollectionPersister $persister The collection persister that will be cached. - * @param \Doctrine\ORM\Cache\ConcurrentRegion $region The collection region. - * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. - * @param array $association The association mapping. + * @param \Doctrine\ORM\Persisters\Collection\CollectionPersister $persister The collection persister that will be cached. + * @param \Doctrine\ORM\Cache\ConcurrentRegion $region The collection region. + * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. + * @param array $association The association mapping. */ public function __construct(CollectionPersister $persister, ConcurrentRegion $region, EntityManagerInterface $em, array $association) { diff --git a/lib/Doctrine/ORM/Cache/Persister/AbstractEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php similarity index 96% rename from lib/Doctrine/ORM/Cache/Persister/AbstractEntityPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php index c051a38d0..eae4c8c33 100644 --- a/lib/Doctrine/ORM/Cache/Persister/AbstractEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php @@ -18,7 +18,7 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Entity; use Doctrine\ORM\Cache; use Doctrine\ORM\Cache\Region; @@ -26,10 +26,11 @@ use Doctrine\ORM\Cache\EntityCacheKey; use Doctrine\ORM\Cache\CollectionCacheKey; use Doctrine\ORM\Cache\TimestampCacheKey; use Doctrine\ORM\Cache\QueryCacheKey; +use Doctrine\ORM\Cache\Persister\CachedPersister; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\PersistentCollection; use Doctrine\ORM\EntityManagerInterface; -use Doctrine\ORM\Persisters\EntityPersister; +use Doctrine\ORM\Persisters\Entity\EntityPersister; use Doctrine\Common\Util\ClassUtils; use Doctrine\Common\Collections\Criteria; @@ -51,7 +52,7 @@ abstract class AbstractEntityPersister implements CachedEntityPersister protected $metadataFactory; /** - * @var \Doctrine\ORM\Persisters\EntityPersister + * @var \Doctrine\ORM\Persisters\Entity\EntityPersister */ protected $persister; @@ -108,10 +109,10 @@ abstract class AbstractEntityPersister implements CachedEntityPersister protected $joinedAssociations; /** - * @param \Doctrine\ORM\Persisters\EntityPersister $persister The entity persister to cache. - * @param \Doctrine\ORM\Cache\Region $region The entity cache region. - * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. - * @param \Doctrine\ORM\Mapping\ClassMetadata $class The entity metadata. + * @param \Doctrine\ORM\Persisters\Entity\EntityPersister $persister The entity persister to cache. + * @param \Doctrine\ORM\Cache\Region $region The entity cache region. + * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. + * @param \Doctrine\ORM\Mapping\ClassMetadata $class The entity metadata. */ public function __construct(EntityPersister $persister, Region $region, EntityManagerInterface $em, ClassMetadata $class) { diff --git a/lib/Doctrine/ORM/Cache/Persister/CachedEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/CachedEntityPersister.php similarity index 91% rename from lib/Doctrine/ORM/Cache/Persister/CachedEntityPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Entity/CachedEntityPersister.php index adf5fa0c6..0c9078cec 100644 --- a/lib/Doctrine/ORM/Cache/Persister/CachedEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/CachedEntityPersister.php @@ -18,10 +18,11 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Entity; use Doctrine\ORM\Cache\EntityCacheKey; -use Doctrine\ORM\Persisters\EntityPersister; +use Doctrine\ORM\Cache\Persister\CachedPersister; +use Doctrine\ORM\Persisters\Entity\EntityPersister; /** * Interface for second level cache entity persisters. diff --git a/lib/Doctrine/ORM/Cache/Persister/NonStrictReadWriteCachedEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php similarity index 98% rename from lib/Doctrine/ORM/Cache/Persister/NonStrictReadWriteCachedEntityPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php index ca7f8bc2d..b120ae2fa 100644 --- a/lib/Doctrine/ORM/Cache/Persister/NonStrictReadWriteCachedEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php @@ -18,7 +18,7 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Entity; use Doctrine\Common\Util\ClassUtils; use Doctrine\ORM\Cache\EntityCacheKey; diff --git a/lib/Doctrine/ORM/Cache/Persister/ReadOnlyCachedEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersister.php similarity index 96% rename from lib/Doctrine/ORM/Cache/Persister/ReadOnlyCachedEntityPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersister.php index 69db37f60..ce93d7b0e 100644 --- a/lib/Doctrine/ORM/Cache/Persister/ReadOnlyCachedEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersister.php @@ -18,7 +18,7 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Entity; use Doctrine\ORM\Cache\CacheException; use Doctrine\Common\Util\ClassUtils; diff --git a/lib/Doctrine/ORM/Cache/Persister/ReadWriteCachedEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/ReadWriteCachedEntityPersister.php similarity index 88% rename from lib/Doctrine/ORM/Cache/Persister/ReadWriteCachedEntityPersister.php rename to lib/Doctrine/ORM/Cache/Persister/Entity/ReadWriteCachedEntityPersister.php index 1b3af3ab7..0f65e4c9b 100644 --- a/lib/Doctrine/ORM/Cache/Persister/ReadWriteCachedEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/ReadWriteCachedEntityPersister.php @@ -18,12 +18,11 @@ * . */ -namespace Doctrine\ORM\Cache\Persister; +namespace Doctrine\ORM\Cache\Persister\Entity; -use Doctrine\ORM\Persisters\EntityPersister; +use Doctrine\ORM\Persisters\Entity\EntityPersister; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\EntityManagerInterface; - use Doctrine\ORM\Cache\ConcurrentRegion; use Doctrine\ORM\Cache\EntityCacheKey; @@ -36,10 +35,10 @@ use Doctrine\ORM\Cache\EntityCacheKey; class ReadWriteCachedEntityPersister extends AbstractEntityPersister { /** - * @param \Doctrine\ORM\Persister\EntityPersister $persister The entity persister to cache. - * @param \Doctrine\ORM\Cache\ConcurrentRegion $region The entity cache region. - * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. - * @param \Doctrine\ORM\Mapping\ClassMetadata $class The entity metadata. + * @param \Doctrine\ORM\Persister\Entity\EntityPersister $persister The entity persister to cache. + * @param \Doctrine\ORM\Cache\ConcurrentRegion $region The entity cache region. + * @param \Doctrine\ORM\EntityManagerInterface $em The entity manager. + * @param \Doctrine\ORM\Mapping\ClassMetadata $class The entity metadata. */ public function __construct(EntityPersister $persister, ConcurrentRegion $region, EntityManagerInterface $em, ClassMetadata $class) { diff --git a/lib/Doctrine/ORM/LazyCriteriaCollection.php b/lib/Doctrine/ORM/LazyCriteriaCollection.php index 4c6155d70..28e2709ac 100644 --- a/lib/Doctrine/ORM/LazyCriteriaCollection.php +++ b/lib/Doctrine/ORM/LazyCriteriaCollection.php @@ -23,8 +23,8 @@ use Doctrine\Common\Collections\AbstractLazyCollection; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Selectable; -use Doctrine\ORM\Persisters\BasicEntityPersister; -use Doctrine\ORM\Persisters\EntityPersister; +use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; +use Doctrine\ORM\Persisters\Entity\EntityPersister; /** * A lazy collection that allow a fast count when using criteria object diff --git a/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php b/lib/Doctrine/ORM/Persisters/Collection/AbstractCollectionPersister.php similarity index 98% rename from lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php rename to lib/Doctrine/ORM/Persisters/Collection/AbstractCollectionPersister.php index 669cc22f2..b73744ee4 100644 --- a/lib/Doctrine/ORM/Persisters/AbstractCollectionPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/AbstractCollectionPersister.php @@ -17,7 +17,7 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Collection; use Doctrine\ORM\EntityManager; use Doctrine\ORM\UnitOfWork; diff --git a/lib/Doctrine/ORM/Persisters/CollectionPersister.php b/lib/Doctrine/ORM/Persisters/Collection/CollectionPersister.php similarity index 98% rename from lib/Doctrine/ORM/Persisters/CollectionPersister.php rename to lib/Doctrine/ORM/Persisters/Collection/CollectionPersister.php index 855b85a30..36b5706a0 100644 --- a/lib/Doctrine/ORM/Persisters/CollectionPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/CollectionPersister.php @@ -17,7 +17,7 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Collection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\PersistentCollection; diff --git a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php similarity index 99% rename from lib/Doctrine/ORM/Persisters/ManyToManyPersister.php rename to lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php index 50cf89a56..40b1be958 100644 --- a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php @@ -17,10 +17,12 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Collection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\ORM\Persisters\SqlExpressionVisitor; +use Doctrine\ORM\Persisters\SqlValueVisitor; use Doctrine\ORM\PersistentCollection; use Doctrine\ORM\Query; diff --git a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php similarity index 98% rename from lib/Doctrine/ORM/Persisters/OneToManyPersister.php rename to lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php index f610942cc..ee550a922 100644 --- a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php @@ -17,11 +17,10 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Collection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\PersistentCollection; -use Doctrine\ORM\UnitOfWork; /** * Persister for one-to-many collections. diff --git a/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php b/lib/Doctrine/ORM/Persisters/Entity/AbstractEntityInheritancePersister.php similarity index 98% rename from lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php rename to lib/Doctrine/ORM/Persisters/Entity/AbstractEntityInheritancePersister.php index 422249579..36d84d415 100644 --- a/lib/Doctrine/ORM/Persisters/AbstractEntityInheritancePersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/AbstractEntityInheritancePersister.php @@ -17,7 +17,7 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Entity; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\DBAL\Types\Type; diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php similarity index 99% rename from lib/Doctrine/ORM/Persisters/BasicEntityPersister.php rename to lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 5947c67d5..e6d79696c 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -17,7 +17,7 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Entity; use Doctrine\DBAL\LockMode; use Doctrine\DBAL\Types\Type; @@ -31,6 +31,8 @@ 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; diff --git a/lib/Doctrine/ORM/Persisters/EntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php similarity index 99% rename from lib/Doctrine/ORM/Persisters/EntityPersister.php rename to lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php index 7a0190a16..55887eefa 100644 --- a/lib/Doctrine/ORM/Persisters/EntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php @@ -17,7 +17,7 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Entity; use Doctrine\ORM\PersistentCollection; use Doctrine\Common\Collections\Criteria; diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php similarity index 99% rename from lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php rename to lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php index d2321dc10..b1bd56d8c 100644 --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php @@ -17,7 +17,7 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Entity; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query\ResultSetMapping; diff --git a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php b/lib/Doctrine/ORM/Persisters/Entity/SingleTablePersister.php similarity index 99% rename from lib/Doctrine/ORM/Persisters/SingleTablePersister.php rename to lib/Doctrine/ORM/Persisters/Entity/SingleTablePersister.php index 5b60f06a0..d0148f9cf 100644 --- a/lib/Doctrine/ORM/Persisters/SingleTablePersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/SingleTablePersister.php @@ -17,7 +17,7 @@ * . */ -namespace Doctrine\ORM\Persisters; +namespace Doctrine\ORM\Persisters\Entity; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Common\Collections\Criteria; diff --git a/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php b/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php index 7736943c6..f23bfa3da 100644 --- a/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php +++ b/lib/Doctrine/ORM/Persisters/SqlExpressionVisitor.php @@ -25,6 +25,7 @@ use Doctrine\Common\Collections\Expr\ExpressionVisitor; use Doctrine\Common\Collections\Expr\Comparison; use Doctrine\Common\Collections\Expr\Value; use Doctrine\Common\Collections\Expr\CompositeExpression; +use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; /** * Visit Expressions and generate SQL WHERE conditions from them. @@ -35,7 +36,7 @@ use Doctrine\Common\Collections\Expr\CompositeExpression; class SqlExpressionVisitor extends ExpressionVisitor { /** - * @var \Doctrine\ORM\Persisters\BasicEntityPersister + * @var \Doctrine\ORM\Persisters\Entity\BasicEntityPersister */ private $persister; @@ -45,7 +46,8 @@ class SqlExpressionVisitor extends ExpressionVisitor private $classMetadata; /** - * @param \Doctrine\ORM\Persisters\BasicEntityPersister $persister + * @param \Doctrine\ORM\Persisters\Entity\BasicEntityPersister $persister + * @param \Doctrine\ORM\Mapping\ClassMetadata $classMetadata */ public function __construct(BasicEntityPersister $persister, ClassMetadata $classMetadata) { diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 393353cdc..94e29e22b 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -25,7 +25,7 @@ use Doctrine\Common\Proxy\ProxyDefinition; use Doctrine\Common\Util\ClassUtils; use Doctrine\Common\Proxy\Proxy as BaseProxy; use Doctrine\Common\Proxy\ProxyGenerator; -use Doctrine\ORM\Persisters\EntityPersister; +use Doctrine\ORM\Persisters\Entity\EntityPersister; use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityNotFoundException; use Doctrine\ORM\Utility\IdentifierFlattener; @@ -115,7 +115,7 @@ class ProxyFactory extends AbstractProxyFactory * Creates a closure capable of initializing a proxy * * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata - * @param \Doctrine\ORM\Persisters\EntityPersister $entityPersister + * @param \Doctrine\ORM\Persisters\Entity\EntityPersister $entityPersister * * @return \Closure * @@ -201,7 +201,7 @@ class ProxyFactory extends AbstractProxyFactory * Creates a closure capable of finalizing state a cloned proxy * * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata - * @param \Doctrine\ORM\Persisters\EntityPersister $entityPersister + * @param \Doctrine\ORM\Persisters\Entity\EntityPersister $entityPersister * * @return \Closure * diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index e91ff3d12..5749273dc 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -41,11 +41,11 @@ use Doctrine\ORM\Event\PostFlushEventArgs; use Doctrine\ORM\Event\ListenersInvoker; use Doctrine\ORM\Cache\Persister\CachedPersister; -use Doctrine\ORM\Persisters\BasicEntityPersister; -use Doctrine\ORM\Persisters\SingleTablePersister; -use Doctrine\ORM\Persisters\JoinedSubclassPersister; -use Doctrine\ORM\Persisters\OneToManyPersister; -use Doctrine\ORM\Persisters\ManyToManyPersister; +use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; +use Doctrine\ORM\Persisters\Entity\SingleTablePersister; +use Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister; +use Doctrine\ORM\Persisters\Collection\OneToManyPersister; +use Doctrine\ORM\Persisters\Collection\ManyToManyPersister; use Doctrine\ORM\Utility\IdentifierFlattener; /** @@ -3040,7 +3040,7 @@ class UnitOfWork implements PropertyChangedListener * * @param string $entityName The name of the Entity. * - * @return \Doctrine\ORM\Persisters\EntityPersister + * @return \Doctrine\ORM\Persisters\Entity\EntityPersister */ public function getEntityPersister($entityName) { @@ -3084,7 +3084,7 @@ class UnitOfWork implements PropertyChangedListener * * @param array $association * - * @return \Doctrine\ORM\Persisters\CollectionPersister + * @return \Doctrine\ORM\Persisters\Collection\CollectionPersister */ public function getCollectionPersister(array $association) { diff --git a/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php b/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php index 4df977729..ac2157b52 100644 --- a/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php +++ b/tests/Doctrine/Tests/Mocks/EntityPersisterMock.php @@ -1,12 +1,13 @@ factory->buildCachedEntityPersister($em, $persister, $metadata); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $cachedPersister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\ReadOnlyCachedEntityPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\ReadOnlyCachedEntityPersister', $cachedPersister); } public function testBuildCachedEntityPersisterReadWrite() @@ -88,8 +88,8 @@ class DefaultCacheFactoryTest extends OrmTestCase $cachedPersister = $this->factory->buildCachedEntityPersister($em, $persister, $metadata); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $cachedPersister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', $cachedPersister); } public function testBuildCachedEntityPersisterNonStrictReadWrite() @@ -109,8 +109,8 @@ class DefaultCacheFactoryTest extends OrmTestCase $cachedPersister = $this->factory->buildCachedEntityPersister($em, $persister, $metadata); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $cachedPersister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\NonStrictReadWriteCachedEntityPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\NonStrictReadWriteCachedEntityPersister', $cachedPersister); } public function testBuildCachedCollectionPersisterReadOnly() @@ -132,8 +132,8 @@ class DefaultCacheFactoryTest extends OrmTestCase $cachedPersister = $this->factory->buildCachedCollectionPersister($em, $persister, $mapping); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedCollectionPersister', $cachedPersister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\ReadOnlyCachedCollectionPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Collection\CachedCollectionPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Collection\ReadOnlyCachedCollectionPersister', $cachedPersister); } public function testBuildCachedCollectionPersisterReadWrite() @@ -154,8 +154,8 @@ class DefaultCacheFactoryTest extends OrmTestCase $cachedPersister = $this->factory->buildCachedCollectionPersister($em, $persister, $mapping); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedCollectionPersister', $cachedPersister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Collection\CachedCollectionPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister', $cachedPersister); } public function testBuildCachedCollectionPersisterNonStrictReadWrite() @@ -176,8 +176,8 @@ class DefaultCacheFactoryTest extends OrmTestCase $cachedPersister = $this->factory->buildCachedCollectionPersister($em, $persister, $mapping); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedCollectionPersister', $cachedPersister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\NonStrictReadWriteCachedCollectionPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Collection\CachedCollectionPersister', $cachedPersister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Collection\NonStrictReadWriteCachedCollectionPersister', $cachedPersister); } public function testInheritedEntityCacheRegion() @@ -192,8 +192,8 @@ class DefaultCacheFactoryTest extends OrmTestCase $cachedPersister1 = $factory->buildCachedEntityPersister($em, $persister1, $metadata1); $cachedPersister2 = $factory->buildCachedEntityPersister($em, $persister2, $metadata2); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $cachedPersister1); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $cachedPersister2); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $cachedPersister1); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $cachedPersister2); $this->assertNotSame($cachedPersister1, $cachedPersister2); $this->assertSame($cachedPersister1->getCacheRegion(), $cachedPersister2->getCacheRegion()); @@ -211,8 +211,8 @@ class DefaultCacheFactoryTest extends OrmTestCase $cachedPersister1 = $factory->buildCachedEntityPersister($em, $persister1, $metadata1); $cachedPersister2 = $factory->buildCachedEntityPersister($em, $persister2, $metadata2); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $cachedPersister1); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $cachedPersister2); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $cachedPersister1); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $cachedPersister2); $this->assertNotSame($cachedPersister1, $cachedPersister2); $this->assertNotSame($cachedPersister1->getCacheRegion(), $cachedPersister2->getCacheRegion()); @@ -281,4 +281,4 @@ class DefaultCacheFactoryTest extends OrmTestCase $this->assertSame('foo', $fooRegion->getCache()->getNamespace()); $this->assertSame('bar', $barRegion->getCache()->getNamespace()); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/AbstractCollectionPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php similarity index 90% rename from tests/Doctrine/Tests/ORM/Cache/Persister/AbstractCollectionPersisterTest.php rename to tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php index e216cd79e..c3db83a44 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/AbstractCollectionPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php @@ -1,12 +1,12 @@ em = $this->_getTestEntityManager(); $this->region = $this->createRegion(); - $this->collectionPersister = $this->getMock('Doctrine\ORM\Persisters\CollectionPersister', $this->collectionPersisterMockMethods); + $this->collectionPersister = $this->getMock('Doctrine\ORM\Persisters\Collection\CollectionPersister', $this->collectionPersisterMockMethods); } /** @@ -115,9 +115,9 @@ abstract class AbstractCollectionPersisterTest extends OrmTestCase { $persister = $this->createPersisterDefault(); - $this->assertInstanceOf('Doctrine\ORM\Persisters\CollectionPersister', $persister); + $this->assertInstanceOf('Doctrine\ORM\Persisters\Collection\CollectionPersister', $persister); $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedPersister', $persister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedCollectionPersister', $persister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Collection\CachedCollectionPersister', $persister); } public function testInvokeDelete() diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/NonStrictReadWriteCachedCollectionPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/NonStrictReadWriteCachedCollectionPersisterTest.php similarity index 69% rename from tests/Doctrine/Tests/ORM/Cache/Persister/NonStrictReadWriteCachedCollectionPersisterTest.php rename to tests/Doctrine/Tests/ORM/Cache/Persister/Collection/NonStrictReadWriteCachedCollectionPersisterTest.php index 2a2b62692..bd65c2077 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/NonStrictReadWriteCachedCollectionPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/NonStrictReadWriteCachedCollectionPersisterTest.php @@ -1,11 +1,11 @@ createPersisterDefault(); $collection = $this->createCollection($entity); $key = new CollectionCacheKey(State::CLASSNAME, 'cities', array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister', 'queuedCache'); $property->setAccessible(true); @@ -163,7 +163,7 @@ class ReadWriteCachedCollectionPersisterTest extends AbstractCollectionPersister $persister = $this->createPersisterDefault(); $collection = $this->createCollection($entity); $key = new CollectionCacheKey(State::CLASSNAME, 'cities', array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister', 'queuedCache'); $property->setAccessible(true); @@ -194,7 +194,7 @@ class ReadWriteCachedCollectionPersisterTest extends AbstractCollectionPersister $persister = $this->createPersisterDefault(); $collection = $this->createCollection($entity); $key = new CollectionCacheKey(State::CLASSNAME, 'cities', array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister', 'queuedCache'); $property->setAccessible(true); @@ -225,7 +225,7 @@ class ReadWriteCachedCollectionPersisterTest extends AbstractCollectionPersister $persister = $this->createPersisterDefault(); $collection = $this->createCollection($entity); $key = new CollectionCacheKey(State::CLASSNAME, 'cities', array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister', 'queuedCache'); $property->setAccessible(true); @@ -255,7 +255,7 @@ class ReadWriteCachedCollectionPersisterTest extends AbstractCollectionPersister $persister = $this->createPersisterDefault(); $collection = $this->createCollection($entity); $key = new CollectionCacheKey(State::CLASSNAME, 'cities', array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister', 'queuedCache'); $property->setAccessible(true); @@ -280,7 +280,7 @@ class ReadWriteCachedCollectionPersisterTest extends AbstractCollectionPersister $persister = $this->createPersisterDefault(); $collection = $this->createCollection($entity); $key = new CollectionCacheKey(State::CLASSNAME, 'cities', array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedCollectionPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Collection\ReadWriteCachedCollectionPersister', 'queuedCache'); $property->setAccessible(true); @@ -298,4 +298,4 @@ class ReadWriteCachedCollectionPersisterTest extends AbstractCollectionPersister $persister->update($collection); $this->assertCount(0, $property->getValue($persister)); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/AbstractEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/AbstractEntityPersisterTest.php similarity index 94% rename from tests/Doctrine/Tests/ORM/Cache/Persister/AbstractEntityPersisterTest.php rename to tests/Doctrine/Tests/ORM/Cache/Persister/Entity/AbstractEntityPersisterTest.php index fcee102b9..116339c87 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/AbstractEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/AbstractEntityPersisterTest.php @@ -1,13 +1,13 @@ em = $this->_getTestEntityManager(); $this->region = $this->createRegion(); - $this->entityPersister = $this->getMock('Doctrine\ORM\Persisters\EntityPersister', $this->entityPersisterMockMethods); + $this->entityPersister = $this->getMock('Doctrine\ORM\Persisters\Entity\EntityPersister', $this->entityPersisterMockMethods); } /** @@ -120,9 +120,9 @@ abstract class AbstractEntityPersisterTest extends OrmTestCase { $persister = $this->createPersisterDefault(); - $this->assertInstanceOf('Doctrine\ORM\Persisters\EntityPersister', $persister); + $this->assertInstanceOf('Doctrine\ORM\Persisters\Entity\EntityPersister', $persister); $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedPersister', $persister); - $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\CachedEntityPersister', $persister); + $this->assertInstanceOf('Doctrine\ORM\Cache\Persister\Entity\CachedEntityPersister', $persister); } public function testInvokeAddInsert() diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/NonStrictReadWriteCachedEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersisterTest.php similarity index 90% rename from tests/Doctrine/Tests/ORM/Cache/Persister/NonStrictReadWriteCachedEntityPersisterTest.php rename to tests/Doctrine/Tests/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersisterTest.php index 13d7b0f31..6cf3fea3b 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/NonStrictReadWriteCachedEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersisterTest.php @@ -1,6 +1,6 @@ createPersisterDefault(); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -50,7 +50,7 @@ class NonStrictReadWriteCachedEntityPersisterTest extends AbstractEntityPersiste $persister = $this->createPersisterDefault(); $key = new EntityCacheKey(Country::CLASSNAME, array('id'=>1)); $entry = new EntityCacheEntry(Country::CLASSNAME, array('id'=>1, 'name'=>'Foo')); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -87,7 +87,7 @@ class NonStrictReadWriteCachedEntityPersisterTest extends AbstractEntityPersiste $persister = $this->createPersisterDefault(); $key = new EntityCacheKey(Country::CLASSNAME, array('id'=>1)); $entry = new EntityCacheEntry(Country::CLASSNAME, array('id'=>1, 'name'=>'Foo')); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -115,7 +115,7 @@ class NonStrictReadWriteCachedEntityPersisterTest extends AbstractEntityPersiste $entity = new Country("Foo"); $persister = $this->createPersisterDefault(); $key = new EntityCacheKey(Country::CLASSNAME, array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -137,4 +137,4 @@ class NonStrictReadWriteCachedEntityPersisterTest extends AbstractEntityPersiste $this->assertCount(0, $property->getValue($persister)); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/ReadOnlyCachedEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersisterTest.php similarity index 83% rename from tests/Doctrine/Tests/ORM/Cache/Persister/ReadOnlyCachedEntityPersisterTest.php rename to tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersisterTest.php index 2e21e23e9..716ea15cb 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/ReadOnlyCachedEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersisterTest.php @@ -1,13 +1,13 @@ update($entity); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/ReadWriteCachedEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadWriteCachedEntityPersisterTest.php similarity index 94% rename from tests/Doctrine/Tests/ORM/Cache/Persister/ReadWriteCachedEntityPersisterTest.php rename to tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadWriteCachedEntityPersisterTest.php index b95ddaef7..1f598a903 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/ReadWriteCachedEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadWriteCachedEntityPersisterTest.php @@ -1,6 +1,6 @@ createPersisterDefault(); $key = new EntityCacheKey(Country::CLASSNAME, array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -159,7 +159,7 @@ class ReadWriteCachedEntityPersisterTest extends AbstractEntityPersisterTest $lock = Lock::createLockRead(); $persister = $this->createPersisterDefault(); $key = new EntityCacheKey(Country::CLASSNAME, array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -189,7 +189,7 @@ class ReadWriteCachedEntityPersisterTest extends AbstractEntityPersisterTest $entity = new Country("Foo"); $persister = $this->createPersisterDefault(); $key = new EntityCacheKey(Country::CLASSNAME, array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -213,7 +213,7 @@ class ReadWriteCachedEntityPersisterTest extends AbstractEntityPersisterTest $entity = new Country("Foo"); $persister = $this->createPersisterDefault(); $key = new EntityCacheKey(Country::CLASSNAME, array('id'=>1)); - $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\ReadWriteCachedEntityPersister', 'queuedCache'); + $property = new \ReflectionProperty('Doctrine\ORM\Cache\Persister\Entity\ReadWriteCachedEntityPersister', 'queuedCache'); $property->setAccessible(true); @@ -231,4 +231,4 @@ class ReadWriteCachedEntityPersisterTest extends AbstractEntityPersisterTest $persister->update($entity); $this->assertCount(0, $property->getValue($persister)); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php index f8aff3790..4b978b1d6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheOneToManyTest.php @@ -124,7 +124,7 @@ class SecondLevelCacheOneToManyTest extends SecondLevelCacheAbstractTest $this->assertEquals($queryCount, $this->getCurrentQueryCount()); } - public function testLoadOnoToManyCollectionFromDatabaseWhenEntityMissing() + public function testLoadOneToManyCollectionFromDatabaseWhenEntityMissing() { $this->loadFixturesCountries(); $this->loadFixturesStates(); @@ -325,9 +325,9 @@ class SecondLevelCacheOneToManyTest extends SecondLevelCacheAbstractTest $this->cache->evictCollectionRegion(State::CLASSNAME, 'cities'); $this->_em->clear(); - $entitiId = $this->states[0]->getId(); + $entityId = $this->states[0]->getId(); $queryCount = $this->getCurrentQueryCount(); - $entity = $this->_em->find(State::CLASSNAME, $entitiId); + $entity = $this->_em->find(State::CLASSNAME, $entityId); $this->assertEquals(2, $entity->getCities()->count()); $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount()); @@ -335,7 +335,7 @@ class SecondLevelCacheOneToManyTest extends SecondLevelCacheAbstractTest $this->_em->clear(); $queryCount = $this->getCurrentQueryCount(); - $entity = $this->_em->find(State::CLASSNAME, $entitiId); + $entity = $this->_em->find(State::CLASSNAME, $entityId); $this->assertEquals(2, $entity->getCities()->count()); $this->assertEquals($queryCount, $this->getCurrentQueryCount()); @@ -381,4 +381,4 @@ class SecondLevelCacheOneToManyTest extends SecondLevelCacheAbstractTest $this->assertEquals(4, $result->getTravels()->count()); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php b/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php index ef9d72b26..2f228f98b 100644 --- a/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php @@ -16,7 +16,7 @@ use PHPUnit_Framework_TestCase; class LazyCriteriaCollectionTest extends PHPUnit_Framework_TestCase { /** - * @var \Doctrine\ORM\Persisters\EntityPersister|\PHPUnit_Framework_MockObject_MockObject + * @var \Doctrine\ORM\Persisters\Entity\EntityPersister|\PHPUnit_Framework_MockObject_MockObject */ private $persister; @@ -35,7 +35,7 @@ class LazyCriteriaCollectionTest extends PHPUnit_Framework_TestCase */ protected function setUp() { - $this->persister = $this->getMock('Doctrine\ORM\Persisters\EntityPersister'); + $this->persister = $this->getMock('Doctrine\ORM\Persisters\Entity\EntityPersister'); $this->criteria = new Criteria(); $this->lazyCriteriaCollection = new LazyCriteriaCollection($this->persister, $this->criteria); } diff --git a/tests/Doctrine/Tests/ORM/Performance/ProxyPerformanceTest.php b/tests/Doctrine/Tests/ORM/Performance/ProxyPerformanceTest.php index f06e273ab..a43907f9e 100644 --- a/tests/Doctrine/Tests/ORM/Performance/ProxyPerformanceTest.php +++ b/tests/Doctrine/Tests/ORM/Performance/ProxyPerformanceTest.php @@ -24,7 +24,7 @@ use Doctrine\Common\Proxy\Proxy; use Doctrine\ORM\EntityManager; use Doctrine\ORM\UnitOfWork; use Doctrine\ORM\Proxy\ProxyFactory; -use Doctrine\ORM\Persisters\BasicEntityPersister; +use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; /** * Performance test used to measure performance of proxy instantiation @@ -168,4 +168,4 @@ class PersisterMock extends BasicEntityPersister { return $entity; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php index 8e9ac08df..dd058f050 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php @@ -4,8 +4,7 @@ namespace Doctrine\Tests\ORM\Persisters; use Doctrine\Common\Collections\Criteria; use Doctrine\DBAL\Types\Type as DBALType; -use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Persisters\BasicEntityPersister; +use Doctrine\ORM\Persisters\Entity\BasicEntityPersister; use Doctrine\Tests\Models\CustomType\CustomTypeParent; use Doctrine\Tests\Models\CustomType\CustomTypeChild; use Doctrine\Tests\Models\CustomType\CustomTypeFriend; diff --git a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php index 6c3bce3cf..18145070f 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php @@ -19,13 +19,13 @@ namespace Doctrine\Tests\ORM\Persisters; -use Doctrine\ORM\Persisters\JoinedSubclassPersister; +use Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister; use Doctrine\Tests\OrmTestCase; /** - * Tests for {@see \Doctrine\ORM\Persisters\JoinedSubclassPersister} + * Tests for {@see \Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister} * - * @covers \Doctrine\ORM\Persisters\JoinedSubclassPersister + * @covers \Doctrine\ORM\Persisters\Entity\JoinedSubclassPersister */ class JoinedSubClassPersisterTest extends OrmTestCase { diff --git a/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php b/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php index 227cd608a..a8a2adaba 100644 --- a/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php @@ -55,7 +55,7 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase { $identifier = array('id' => 42); $proxyClass = 'Proxies\__CG__\Doctrine\Tests\Models\ECommerce\ECommerceFeature'; - $persister = $this->getMock('Doctrine\ORM\Persisters\BasicEntityPersister', array('load'), array(), '', false); + $persister = $this->getMock('Doctrine\ORM\Persisters\Entity\BasicEntityPersister', array('load'), array(), '', false); $this->uowMock->setEntityPersister('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $persister); $proxy = $this->proxyFactory->getProxy('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $identifier); @@ -88,7 +88,7 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase */ public function testFailedProxyLoadingDoesNotMarkTheProxyAsInitialized() { - $persister = $this->getMock('Doctrine\ORM\Persisters\BasicEntityPersister', array('load'), array(), '', false); + $persister = $this->getMock('Doctrine\ORM\Persisters\Entity\BasicEntityPersister', array('load'), array(), '', false); $this->uowMock->setEntityPersister('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $persister); /* @var $proxy \Doctrine\Common\Proxy\Proxy */ @@ -115,7 +115,7 @@ class ProxyFactoryTest extends \Doctrine\Tests\OrmTestCase */ public function testFailedProxyCloningDoesNotMarkTheProxyAsInitialized() { - $persister = $this->getMock('Doctrine\ORM\Persisters\BasicEntityPersister', array('load'), array(), '', false); + $persister = $this->getMock('Doctrine\ORM\Persisters\Entity\BasicEntityPersister', array('load'), array(), '', false); $this->uowMock->setEntityPersister('Doctrine\Tests\Models\ECommerce\ECommerceFeature', $persister); /* @var $proxy \Doctrine\Common\Proxy\Proxy */