Unloades all or specified document from memory.

@param mixed $documentID @see phpQuery::getDocumentID() for supported types.
167483
public static function unloadDocuments($id = null) 
    {
        if (isset($id)) {
            if ($id = self::getDocumentID($id)) {
                unset(phpQuery::$documents[$id]);
            }
        } else {
            foreach(phpQuery::$documents as $k => $v) {
                unset(phpQuery::$documents[$k]);
            }
        }
    }
395442
public function getDocument(string $id): Document
    {
        if (isset($this->documents[$id])) {
            return $this->documents[$id];
        }

        if ($this->hasDocument($id)) {
            $path = $this->getDocumentPath($id);
            $source = $this->filesystem->read($path);

            if (is_string($source)) {
                return $this->documents[$id] = new Document($this->format->parse($source));
            }

            throw new RuntimeException(sprintf('Format error in the file "%s"', $path));
        }

        throw new RuntimeException(sprintf('File "%s" not found', $id));
    }
153510
@Override
    public List<DocumentRevision> delete(final String id)
            throws DocumentNotFoundException, DocumentStoreException {
        Misc.checkNotNull(id, "ID");
        try {
            if (id.startsWith(CouchConstants._local_prefix)) {
                String localId = id.substring(CouchConstants._local_prefix.length());
                deleteLocalDocument(localId);
                // for local documents there is no "new document" to return as the document is
                // removed rather than updated with a tombstone
                return Collections.singletonList(null);
            } else {
                return get(queue.submitTransaction(new DeleteAllRevisionsCallable(id)));
            }
        } catch (ExecutionException e) {
            // documentnotfoundexception if it was a non-existent local document
            throwCauseAs(e, DocumentNotFoundException.class);
            String message = "Failed to delete document";
            logger.log(Level.SEVERE, message, e);
            throw new DocumentStoreException(message, e.getCause());
        }
    }
1149746
public static function remove($document, $node, $type = null, $callback = null) 
    {
        $documentID = phpQuery::getDocumentID($document);
        $eventNode = self::getNode($documentID, $node);
        if (is_object($eventNode) && isset($eventNode->eventHandlers[$type])) {
            if ($callback) {
                foreach($eventNode->eventHandlers[$type] as $k => $handler) {
                    if ($handler['callback'] == $callback) {
                        unset($eventNode->eventHandlers[$type][$k]);
                    }
                }
            } else {
                unset($eventNode->eventHandlers[$type]);
            }
        }
    }
8343
public function delete($id)
    {
        if ($id instanceof DocumentInterface) {
            $id = $id->getId();
        }

        $path = $this->getPathForDocument($id);

        return unlink($path);
    }
459490
public function setDocumentId($documentId)
    {
        if (preg_match($this->getDocumentIdRegex(), $documentId)) {
            $this->document_id = $documentId;

            return $this;
        }

        throw new InvalidArgument(
            'document_id must be a string with 10 alphanumeric letters.' .
                     '5 letters, followed by 4 numbers, followed by 1 letter or number. Example: ABCDE1234F'
        );
    }
996426
public function remove($itemID)
    {
        if ($this->items === null) {
            if ( ! $this->fillItems()) {
                return false;
            }
        }

        $this->delFromDb($itemID);

        return $this->delItem($itemID);
    }
471014
public function delete($id)
    {
        if ($id instanceof Zend_Search_Lucene_Search_QueryHit) {
            /* @var $id Zend_Search_Lucene_Search_QueryHit */
            $id = $id->id;
        }

        if ($id >= $this->_docCount) {
            include_once 'Zend/Search/Lucene/Exception.php';
            throw new Zend_Search_Lucene_Exception('Document id is out of the range.');
        }

        $segmentStartId = 0;
        foreach ($this->_segmentInfos as $segmentInfo) {
            if ($segmentStartId + $segmentInfo->count() > $id) {
                break;
            }

            $segmentStartId += $segmentInfo->count();
        }
        $segmentInfo->delete($id - $segmentStartId);

        $this->_hasChanges = true;
    }
1143472
public static function releaseId($generatedId)
    {
        $index = array_search($generatedId, static::$generatedIds, true);
        if ($index !== false) {
            unset(static::$generatedIds[$index]);
        }
    }
1327568
public function clear(?string $documentClass = null): void
    {
        if (null === $documentClass) {
            $this->identityMap =
            $this->objects =
            $this->documentStates =
            $this->documentPersisters =
            $this->documentDeletions =
            $this->documentUpdates =
            $this->documentChangeSets =
            $this->readOnlyObjects =
            $this->originalDocumentData = [];
        } else {
            throw new \Exception('Not implemented yet.');
        }

        if ($this->evm->hasListeners(Events::onClear)) {
            $this->evm->dispatchEvent(Events::onClear, new Events\OnClearEventArgs($this->manager, $documentClass));
        }
    }
169495
public function loadRenditionContentLink($repositoryId, $documentId, $streamId)
    {
        $result = $this->getRepositoryUrlCache()->getObjectUrl($repositoryId, $documentId, Constants::SELECTOR_CONTENT);
        if ($result !== null) {
            $result->getQuery()->modify([Constants::PARAM_STREAM_ID => $streamId]);
            $result = (string) $result;
        }
        return $result;
    }
153427
static function purgeForObject( $contentObjectID )
    {
        if ( !is_numeric( $contentObjectID ) )
            return false;
        $db = eZDB::instance();
        $db->begin();
        $db->query( "DELETE FROM ezcontentobject_trash WHERE contentobject_id='$contentObjectID'" );
        $db->commit();
    }
744671
public void unload(String resourceId) {
        LoadableResource res = this.resources.get(resourceId);
        if (Objects.nonNull(res)) {
            res.unload();
        }
    }
62078
public void unload(String resourceId) {
        LoadableResource res = this.resources.get(resourceId);
        if (res!=null) {
            res.unload();
        }
    }
253534
public function get($documentId, $cache = true)
    {
        $rtn = $this->getCache($documentId);

        if (!$cache || !$rtn) {
            list($status, $doc) = $this->sendRequest(urlencode($documentId));

            if ($status == 200) {
                $rtn = $this->setCache($documentId, $doc);
            } else {
                $rtn = null;
            }
        }

        return $this->asDocs ? $this->toDocument($rtn) : $rtn;
    }
796774
public static function fetchByNodeId( $nodeId )
    {
        $node = eZContentObjectTreeNode::fetch( $nodeId );
        if ( $node instanceof eZContentObjectTreeNode )
        {
            return self::fromNode( $node );
        }
        else
        {
            // @TODO Currently this exception is only in rest package. Needs to be fixed.
            throw new ezpContentNotFoundException( "Unable to find node with ID $nodeId" );
        }
    }
1112930
public function unregisterActionId($id)
    {
        if (is_array($id)) {
            foreach ($id as $each) {
                $this->unregisterActionId($each);
            }
            return $this;
        }

        foreach ($this->_actionhandler as $i => &$handlerinfo) {
            if ($handlerinfo['id'] == $id) {
                unset($this->_actionhandler[$i]);

                $this->log(SMARTIRC_DEBUG_ACTIONHANDLER, 'DEBUG_ACTIONHANDLER: '
                    .'actionhandler('.$id.') unregistered', __FILE__, __LINE__
                );
                $this->_actionhandler = array_values($this->_actionhandler);
                return $this;
            }
        }

        $this->log(SMARTIRC_DEBUG_ACTIONHANDLER, 'DEBUG_ACTIONHANDLER: could '
            .'not find actionhandler id: '.$id.' _not_ unregistered',
            __FILE__, __LINE__
        );
        return false;
    }