public function prepareUpdateData($document)
 {
     $oid = spl_object_hash($document);
     $changeset = $this->_uow->getDocumentChangeSet($document);
     $result = array();
     foreach ($this->_class->fieldMappings as $mapping) {
         $old = isset($changeset[$mapping['fieldName']][0]) ? $changeset[$mapping['fieldName']][0] : null;
         $new = isset($changeset[$mapping['fieldName']][1]) ? $changeset[$mapping['fieldName']][1] : null;
         $new = $this->_prepareValue($mapping, $new);
         $old = $this->_prepareValue($mapping, $old);
         if ($mapping['type'] === 'many' || $mapping['type'] === 'collection') {
             $this->_addArrayUpdateAtomicOperator($mapping, (array) $new, (array) $old, $result);
         } else {
             $this->_addFieldUpdateAtomicOperator($mapping, $new, $old, $result);
         }
     }
     return $result;
 }