Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unit test to demonstrate that @malarzm's atomicset feature seems to fix the data corruption problem #3

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Fixed prepareQuery for atomicSetArray and removed unused method
  • Loading branch information
malarzm committed May 16, 2015
commit ae0189423633a3bdf000f8723e4b552dcb80aed8
14 changes: 1 addition & 13 deletions lib/Doctrine/ODM/MongoDB/Persisters/CollectionPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function prepareSetQuery(PersistentCollection $coll)

$setData = $coll->map($callback)->toArray();

if ($mapping['strategy'] === 'setArray') {
if ($mapping['strategy'] === 'setArray' || $mapping['strategy'] === 'atomicSetArray') {
$setData = array_values($setData);
}

Expand Down Expand Up @@ -260,18 +260,6 @@ private function insertElements(PersistentCollection $coll, array $options)
$this->executeQuery($parent, $query, $options);
}

/**
* Gets the document database identifier value for the given document.
*
* @param object $document
* @param ClassMetadata $class
* @return mixed $id
*/
private function getDocumentId($document, ClassMetadata $class)
{
return $class->getDatabaseIdentifierValue($this->uow->getDocumentIdentifier($document));
}

/**
* Gets the parent information for a given PersistentCollection. It will
* retrieve the top-level persistent Document that the PersistentCollection
Expand Down