Skip to content

Commit

Permalink
Document deprecation of AbstractCollectionPersister helpers (doctrine…
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus authored and n-e-m-a-nj-a committed Mar 29, 2022
1 parent 469d4e6 commit 4a8821f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Upgrade to 2.12

## Deprecate helper methods from `AbstractCollectionPersister`

The following protected methods of
`Doctrine\ORM\Cache\Persister\Collection\AbstractCollectionPersister`
are not in use anymore and will be removed.

* `evictCollectionCache()`
* `evictElementCache()`

## Deprecate `Doctrine\ORM\Query\TreeWalkerChainIterator`

This class won't have a replacement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\Deprecations\Deprecation;
use Doctrine\ORM\Cache\CollectionCacheKey;
use Doctrine\ORM\Cache\CollectionHydrator;
use Doctrine\ORM\Cache\EntityCacheKey;
Expand Down Expand Up @@ -230,6 +231,12 @@ public function loadCriteria(PersistentCollection $collection, Criteria $criteri
*/
protected function evictCollectionCache(PersistentCollection $collection)
{
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/pull/9512',
'The method %s() is deprecated and will be removed without replacement.'
);

$key = new CollectionCacheKey(
$this->sourceEntity->rootEntityName,
$this->association['fieldName'],
Expand All @@ -254,6 +261,12 @@ protected function evictCollectionCache(PersistentCollection $collection)
*/
protected function evictElementCache($targetEntity, $element)
{
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/pull/9512',
'The method %s() is deprecated and will be removed without replacement.'
);

$targetPersister = $this->uow->getEntityPersister($targetEntity);
assert($targetPersister instanceof CachedEntityPersister);
$targetRegion = $targetPersister->getCacheRegion();
Expand Down

0 comments on commit 4a8821f

Please sign in to comment.