Skip to content

Commit

Permalink
Classify persisters into more granular namespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeblanco committed Jan 15, 2015
1 parent 0b2fb7f commit 49e8b3b
Show file tree
Hide file tree
Showing 42 changed files with 183 additions and 178 deletions.
21 changes: 10 additions & 11 deletions lib/Doctrine/ORM/Cache/CacheFactory.php
Expand Up @@ -22,9 +22,8 @@

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.
Expand All @@ -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);

Expand Down
16 changes: 8 additions & 8 deletions lib/Doctrine/ORM/Cache/DefaultCacheFactory.php
Expand Up @@ -29,14 +29,14 @@
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
Expand Down
Expand Up @@ -18,12 +18,12 @@
* <http://www.doctrine-project.org>.
*/

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;
Expand All @@ -46,7 +46,7 @@ abstract class AbstractCollectionPersister implements CachedCollectionPersister
protected $metadataFactory;

/**
* @var \Doctrine\ORM\Persisters\CollectionPersister
* @var \Doctrine\ORM\Persisters\Collection\CollectionPersister
*/
protected $persister;

Expand Down Expand Up @@ -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)
{
Expand Down
Expand Up @@ -18,10 +18,11 @@
* <http://www.doctrine-project.org>.
*/

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;

/**
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Cache\Persister;
namespace Doctrine\ORM\Cache\Persister\Collection;

use Doctrine\ORM\Cache\CollectionCacheKey;
use Doctrine\ORM\PersistentCollection;
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Cache\Persister;
namespace Doctrine\ORM\Cache\Persister\Collection;

use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\Cache\CacheException;
Expand Down
Expand Up @@ -18,11 +18,10 @@
* <http://www.doctrine-project.org>.
*/

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;
Expand All @@ -34,10 +33,10 @@
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)
{
Expand Down
Expand Up @@ -18,18 +18,19 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Cache\Persister;
namespace Doctrine\ORM\Cache\Persister\Entity;

use Doctrine\ORM\Cache;
use Doctrine\ORM\Cache\Region;
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;
Expand All @@ -51,7 +52,7 @@ abstract class AbstractEntityPersister implements CachedEntityPersister
protected $metadataFactory;

/**
* @var \Doctrine\ORM\Persisters\EntityPersister
* @var \Doctrine\ORM\Persisters\Entity\EntityPersister
*/
protected $persister;

Expand Down Expand Up @@ -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)
{
Expand Down
Expand Up @@ -18,10 +18,11 @@
* <http://www.doctrine-project.org>.
*/

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.
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Cache\Persister;
namespace Doctrine\ORM\Cache\Persister\Entity;

use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\Cache\EntityCacheKey;
Expand Down
Expand Up @@ -18,7 +18,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Cache\Persister;
namespace Doctrine\ORM\Cache\Persister\Entity;

use Doctrine\ORM\Cache\CacheException;
use Doctrine\Common\Util\ClassUtils;
Expand Down
Expand Up @@ -18,12 +18,11 @@
* <http://www.doctrine-project.org>.
*/

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;

Expand All @@ -36,10 +35,10 @@
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)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/LazyCriteriaCollection.php
Expand Up @@ -23,8 +23,8 @@
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
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Persisters;
namespace Doctrine\ORM\Persisters\Collection;

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\UnitOfWork;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Persisters;
namespace Doctrine\ORM\Persisters\Collection;

use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\PersistentCollection;
Expand Down
Expand Up @@ -17,10 +17,12 @@
* <http://www.doctrine-project.org>.
*/

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;

Expand Down
Expand Up @@ -17,11 +17,10 @@
* <http://www.doctrine-project.org>.
*/

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.
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Persisters;
namespace Doctrine\ORM\Persisters\Entity;

use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\DBAL\Types\Type;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Persisters;
namespace Doctrine\ORM\Persisters\Entity;

use Doctrine\DBAL\LockMode;
use Doctrine\DBAL\Types\Type;
Expand All @@ -31,6 +31,8 @@
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;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Persisters;
namespace Doctrine\ORM\Persisters\Entity;

use Doctrine\ORM\PersistentCollection;
use Doctrine\Common\Collections\Criteria;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Persisters;
namespace Doctrine\ORM\Persisters\Entity;

use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query\ResultSetMapping;
Expand Down
Expand Up @@ -17,7 +17,7 @@
* <http://www.doctrine-project.org>.
*/

namespace Doctrine\ORM\Persisters;
namespace Doctrine\ORM\Persisters\Entity;

use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\Common\Collections\Criteria;
Expand Down

0 comments on commit 49e8b3b

Please sign in to comment.