SubmissionFileNativeXmlFilter::addPubIdentifier PHP Method

addPubIdentifier() public method

Add a single pub ID element for a given plugin to the document.
public addPubIdentifier ( $doc, $revisionNode, $submissionFile, $pubIdPlugin ) : DOMElement | null
$doc DOMDocument
$revisionNode DOMElement
$submissionFile SubmissionFile
$pubIdPlugin PubIdPlugin
return DOMElement | null
    function addPubIdentifier($doc, $revisionNode, $submissionFile, $pubIdPlugin)
    {
        $pubId = $submissionFile->getStoredPubId($pubIdPlugin->getPubIdType());
        if ($pubId) {
            $deployment = $this->getDeployment();
            $revisionNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'id', htmlspecialchars($pubId, ENT_COMPAT, 'UTF-8')));
            $node->setAttribute('type', $pubIdPlugin->getPubIdType());
            $node->setAttribute('advice', 'update');
            return $node;
        }
        return null;
    }