computeChangeSet() public method

Modifies/populates the following properties: {@link originalDocumentData} If the document is NEW or MANAGED but not yet fully persisted (only has an id) then it was not fetched from the database and therefore we have no original document data yet. All of the current document data is stored as the original document data. {@link documentChangeSets} The changes detected on all properties of the document are stored there. A change is a tuple array where the first entry is the old value and the second entry is the new value of the property. Changesets are used by persisters to INSERT/UPDATE the persistent document state. {@link documentUpdates} If the document is already fully MANAGED (has been fetched from the database before) and any changes to its properties are detected, then a reference to the document is stored there to mark it for an update.
public computeChangeSet ( ClassMetadata $class, object $document )
$class Doctrine\ODM\MongoDB\Mapping\ClassMetadata The class descriptor of the document.
$document object The document for which to compute the changes.
 /**
  * @param PermissionsAwareInterface[] $documents
  * @param DocumentManager $dm
  * @param UnitOfWork $uow
  * @param bool $insert
  */
 protected function process($documents, DocumentManager $dm, UnitOfWork $uow, $insert = false)
 {
     foreach ($documents as $document) {
         $perms = $document->getPermissions();
         $files = $this->getFiles($document);
         foreach ($files as $file) {
             $filePermissions = $file->getPermissions()->clear()->inherit($perms);
             if ($insert) {
                 $dm->persist($filePermissions);
             }
             $uow->computeChangeSet($dm->getClassMetadata(get_class($file)), $file);
         }
     }
 }