forked from doctrine/orm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This release relaxes [`doctrine/common`](https://github.com/doctrine/common) requirements in order to allow installation of versions that support PHP 7.1 features in proxy class generation. Please note that a similar requirement relaxation still needs to be applied to [`doctrine/dbal`](https://github.com/doctrine/dbal) in order to allow installation of the latest `doctrine/common` versions. [doctrine#6156](doctrine#6156) This version also backports some fixes around the eviction of the second level cache entries of inverse side associations in one-to-many - many-to-one mappings. [doctrine#6159](doctrine#6159) Further fixes were applied in order to have child classes in inheritance mapping share the same timestamp region when the second level cache is enabled. [doctrine#6028](doctrine#6028) Also, `Doctrine\ORM\EntityManager#merge()` now triggers `Doctrine\ORM\Events::prePersist` listeners with the merged entity state whenever an internal `Doctrine\ORM\UnitOfWork#persist()` call is implied. [doctrine#6177](doctrine#6177). Total issues resolved: **8** - [5570: Fix PrePersist EventListener when using merge instead of persist](doctrine#5570) - [6028: Make child entity share the timestamp region with parent class](doctrine#6028) - [6110: Clear $this->collection even when empty, to reset keys](doctrine#6110) - [6156: Allow doctrine/common 2.7](doctrine#6156) - [6159: doctrine#5821 Backport doctrine#1551 - Fixed support for inverse side second level cache](doctrine#6159) - [6174: Merging a new entity with PrePersist event make changes in callback not be considered](doctrine#6174) - [6177: Fix doctrine#6174 doctrine#5570: merging new entities should also trigger prepersist lifecycle callbacks with merged entity data](doctrine#6177) - [6178: Backport doctrine#6177 - fix doctrine#6174 doctrine#5570: merging new entities should also trigger prepersist lifecycle callbacks with the merged data](doctrine#6178) # gpg: directory `/c/Users/PC/.gnupg' created # gpg: new configuration file `/c/Users/PC/.gnupg/gpg.conf' created # gpg: WARNING: options in `/c/Users/PC/.gnupg/gpg.conf' are not yet active during this run # gpg: keyring `/c/Users/PC/.gnupg/pubring.gpg' created # gpg: Signature made Tue Dec 20 00:49:05 2016 FLEST using DSA key ID 12EC2DF8 # gpg: Can't check signature: public key not found # Conflicts: # lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php # lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php # tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php # tests/Doctrine/Tests/ORM/Tools/Pagination/LimitSubqueryOutputWalkerTest.php # tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php
- Loading branch information
Showing
80 changed files
with
1,812 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
|
||
/** | ||
* @author Fabio B. Silva <[email protected]> | ||
* @author Guilherme Blanco <[email protected]> | ||
* @since 2.5 | ||
*/ | ||
abstract class AbstractCollectionPersister implements CachedCollectionPersister | ||
|
@@ -164,10 +165,18 @@ public function loadCollectionCache(PersistentCollection $collection, Collection | |
public function storeCollectionCache(CollectionCacheKey $key, $elements) | ||
{ | ||
/* @var $targetPersister CachedEntityPersister */ | ||
$associationMapping = $this->sourceEntity->associationMappings[$key->association]; | ||
$targetPersister = $this->uow->getEntityPersister($this->targetEntity->rootEntityName); | ||
$targetRegion = $targetPersister->getCacheRegion(); | ||
$targetHydrator = $targetPersister->getEntityHydrator(); | ||
$entry = $this->hydrator->buildCacheEntry($this->targetEntity, $key, $elements); | ||
|
||
// Only preserve ordering if association configured it | ||
if ( ! (isset($associationMapping['indexBy']) && $associationMapping['indexBy'])) { | ||
// Elements may be an array or a Collection | ||
$elements = array_values(is_array($elements) ? $elements : $elements->getValues()); | ||
} | ||
|
||
$entry = $this->hydrator->buildCacheEntry($this->targetEntity, $key, $elements); | ||
|
||
foreach ($entry->identifiers as $index => $entityKey) { | ||
if ($targetRegion->contains($entityKey)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
* Specific non-strict read/write cached entity persister | ||
* | ||
* @author Fabio B. Silva <[email protected]> | ||
* @author Guilherme Blanco <[email protected]> | ||
* @since 2.5 | ||
*/ | ||
class NonStrictReadWriteCachedEntityPersister extends AbstractEntityPersister | ||
|
@@ -77,13 +78,16 @@ public function afterTransactionRolledBack() | |
*/ | ||
public function delete($entity) | ||
{ | ||
$key = new EntityCacheKey($this->class->rootEntityName, $this->uow->getEntityIdentifier($entity)); | ||
$key = new EntityCacheKey($this->class->rootEntityName, $this->uow->getEntityIdentifier($entity)); | ||
$deleted = $this->persister->delete($entity); | ||
|
||
if ($this->persister->delete($entity)) { | ||
if ($deleted) { | ||
$this->region->evict($key); | ||
} | ||
|
||
$this->queuedCache['delete'][] = $key; | ||
|
||
return $deleted; | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
* Specific read-write entity persister | ||
* | ||
* @author Fabio B. Silva <[email protected]> | ||
* @author Guilherme Blanco <[email protected]> | ||
* @since 2.5 | ||
*/ | ||
class ReadWriteCachedEntityPersister extends AbstractEntityPersister | ||
|
@@ -100,21 +101,24 @@ public function afterTransactionRolledBack() | |
*/ | ||
public function delete($entity) | ||
{ | ||
$key = new EntityCacheKey($this->class->rootEntityName, $this->uow->getEntityIdentifier($entity)); | ||
$lock = $this->region->lock($key); | ||
$key = new EntityCacheKey($this->class->rootEntityName, $this->uow->getEntityIdentifier($entity)); | ||
$lock = $this->region->lock($key); | ||
$deleted = $this->persister->delete($entity); | ||
|
||
if ($this->persister->delete($entity)) { | ||
if ($deleted) { | ||
$this->region->evict($key); | ||
} | ||
|
||
if ($lock === null) { | ||
return; | ||
return $deleted; | ||
} | ||
|
||
$this->queuedCache['delete'][] = array( | ||
'lock' => $lock, | ||
'key' => $key | ||
); | ||
|
||
return $deleted; | ||
} | ||
|
||
/** | ||
|
Oops, something went wrong.