Ejemplo n.º 1
0
 private function &processDocumentDeletions(QueryWriter $queryWriter, UnitOfWork $uow, array &$set)
 {
     $ordered = self::orderByType($uow->getDocumentDeletions(), $set);
     if (empty($ordered)) {
         return self::$EMPTY;
     }
     $docs = [];
     foreach ($ordered as $class => $deletes) {
         /** @var ClassMetadata $md */
         $md = $this->metadataFactory->getMetadataFor($class);
         if ($md->isEmbeddedDocument()) {
             continue;
         }
         if ($md->isVertex()) {
             foreach ($deletes as $doc) {
                 $queryWriter->addDeleteVertexQuery($uow->getDocumentRid($doc));
                 $docs[] = [$doc, $md];
             }
         } else {
             foreach ($deletes as $doc) {
                 $queryWriter->addDeleteQuery($uow->getDocumentRid($doc));
                 $docs[] = [$doc, $md];
             }
         }
     }
     return $docs;
 }