Invokes postRemove callbacks and events for given document.
5666
public function postRemove(ClassMetadata $class, object $document) : void
    {
        $class->invokeLifecycleCallbacks(Events::postRemove, $document, [new LifecycleEventArgs($document, $this->dm)]);
        $this->evm->dispatchEvent(Events::postRemove, new LifecycleEventArgs($document, $this->dm));
    }
1085591
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        if (!$document instanceof RoutableBehavior) {
            return;
        }

        $locales = $this->documentInspector->getLocales($document);
        foreach ($locales as $locale) {
            $localizedDocument = $this->documentManager->find($document->getUuid(), $locale);

            $route = $this->routeRepository->findByEntity(
                $localizedDocument->getClass(),
                $localizedDocument->getUuid(),
                $locale
            );
            if (!$route) {
                continue;
            }

            $this->entityManager->remove($route);

            if ($document instanceof ChildrenBehavior) {
                $this->removeChildRoutes($document, $locale);
            }
        }

        $this->entityManager->flush();
    }
1274405
def delete(self) :
        ""
        if self.URL is None :
            raise DeletionError("Can't delete a document that was not saved")
        r = self.connection.session.delete(self.URL)
        data = r.json()

        if (r.status_code != 200 and r.status_code != 202) or 'error' in data :
            raise DeletionError(data['errorMessage'], data)
        self.reset(self.collection)

        self.modified = True
1084077
def processEvent(cls, event):
        
        callbacks = cls.callbacks(type(event))
        keep_going = True
        remove_callbacks = []

        for callback, record, once in callbacks:
            if record is not None and record != event.record:
                continue

            callback(event)
            if once:
                remove_callbacks.append((callback, record))

            if event.preventDefault:
                keep_going = False
                break

        for callback, record in remove_callbacks:
            cls.removeCallback(type(event), callback, record=record)

        return keep_going
288746
public function invokeLifecycleCallbacks(string $event, object $document, ?array $arguments = null) : void
    {
        if (! $document instanceof $this->name) {
            throw new InvalidArgumentException(sprintf('Expected document class "%s"; found: "%s"', $this->name, get_class($document)));
        }

        if (empty($this->lifecycleCallbacks[$event])) {
            return;
        }

        foreach ($this->lifecycleCallbacks[$event] as $callback) {
            if ($arguments !== null) {
                $document->$callback(...$arguments);
            } else {
                $document->$callback();
            }
        }
    }
319008
private function executeDeletions(ClassMetadata $class, array $documents, array $options = []) : void
    {
        $persister = $this->getDocumentPersister($class->name);

        foreach ($documents as $oid => $document) {
            if (! $class->isEmbeddedDocument) {
                $persister->delete($document, $options);
            }
            unset(
                $this->documentDeletions[$oid],
                $this->documentIdentifiers[$oid],
                $this->originalDocumentData[$oid]
            );

            // Clear snapshot information for any referenced PersistentCollection
            // http://www.doctrine-project.org/jira/browse/MODM-95
            foreach ($class->associationMappings as $fieldMapping) {
                if (! isset($fieldMapping['type']) || $fieldMapping['type'] !== ClassMetadata::MANY) {
                    continue;
                }

                $value = $class->reflFields[$fieldMapping['fieldName']]->getValue($document);
                if (! ($value instanceof PersistentCollectionInterface)) {
                    continue;
                }

                $value->clearSnapshot();
            }

            // Document with this $oid after deletion treated as NEW, even if the $oid
            // is obtained by a new document because the old one went out of scope.
            $this->documentStates[$oid] = self::STATE_NEW;

            $this->lifecycleEventManager->postRemove($class, $document);
        }
    }
854090
def remove(self, document_id, namespace, timestamp):
        """"""
        index, doc_type = self._index_and_mapping(namespace)

        action = {
            '_op_type': 'delete',
            '_index': index,
            '_type': doc_type,
            '_id': u(document_id)
        }

        meta_action = {
            '_op_type': 'delete',
            '_index': self.meta_index_name,
            '_type': self.meta_type,
            '_id': u(document_id)
        }

        self.index(action, meta_action)
714610
protected void fireTextNodesRemoved(ITextNode[] textNodes, int index) {
    for (IDatabaseListener iDatabaseListener : listeners) {
      iDatabaseListener.textNodesRemoved(this, textNodes, index);
    }
  }
798558
function onDocumentState (doc, stateFn, callback) {
  let ready = stateFn(doc)

  if (ready) {
    callback(doc)

    return
  }

  const readyListener = () => {
    if (!stateFn(doc)) {
      return
    }

    if (!ready) {
      ready = true
      callback(doc)
    }

    doc.removeEventListener('readystatechange', readyListener)
  }

  doc.addEventListener('readystatechange', readyListener)
}
998674
public function postRemove(ClassMetadata $class, $document)
    {
        $class->invokeLifecycleCallbacks(Event::postRemove, $document, [new LifecycleEventArgs($document, $this->dm)]);
        $this->evm->dispatchEvent(Event::postRemove, new LifecycleEventArgs($document, $this->dm));
    }
1066281
function _onRemoteEdit(event, res) {
        // res = {nodeId, name, value}

        // detach from DOM change events
        if (res.value === "0") {
            Inspector.DOM.off(".EditAgent");
            return;
        }

        // find and store the edited node
        var node = DOMAgent.nodeWithId(res.nodeId);
        node = node.children[0];
        if (!node.location) {
            return;
        }
        _editedNode = node;

        // attach to character data modified events
        Inspector.DOM.on("characterDataModified.EditAgent", _onCharacterDataModified);
    }
964894
function() {
        OpenLayers.Element.removeClass(document.body, "olDragDown");
        this.documentEvents = false;
        OpenLayers.Event.stopObserving(document, "mousemove", this._docMove);
        OpenLayers.Event.stopObserving(document, "mouseup", this._docUp);
    }
416343
def invalidate(self, context, sid):
		""""""
		
		result = self._Document.get_collection().delete_one({'_id': sid})
		
		return result.deleted_count == 1
757406
function performRemove() {
        ClientModelDocService.remove(vm.clientModelDoc)
          .then(deleteClientModelDocSuccess)
          .catch(deleteClientModelDocCatch);

        function deleteClientModelDocSuccess() {
          Toast.show({type: 'success', text: 'ClientModelDoc ' + vm.displayName + ' deleted'});
          vm.showList();
        }

        function deleteClientModelDocCatch(err) {
          Toast.show({
            type: 'warn',
            text: 'Error while deleting clientModelDoc ' + vm.displayName,
            link: {state: $state.$current, params: $stateParams}
          });

          if (form && err) {
            form.setResponseErrors(err, vm.errors);
          }
        }
      }
753603
public function postRemove(EventArgs $eventArgs)
    {
        if (method_exists($eventArgs, 'getEntity')) {
            $this->_triggerEvent(Events::postRemove, $eventArgs->getEntity(), $eventArgs);
        }
    }
361
public function handleRemove(RemoveEvent $event)
    {
        $document = $event->getDocument();
        $this->documentRegistry->deregisterDocument($document);
    }
382101
def trigger(self, attr, old, new, hint=None, setter=None):
        ''' 

        '''
        def invoke():
            callbacks = self._callbacks.get(attr)
            if callbacks:
                for callback in callbacks:
                    callback(attr, old, new)
        if hasattr(self, '_document') and self._document is not None:
            self._document._notify_change(self, attr, old, new, hint, setter, invoke)
        else:
            invoke()