O4DOIXmlFilter::createIdentifierNode PHP Method

createIdentifierNode() public method

Create a work or product id node.
public createIdentifierNode ( $doc, $workOrProduct, $idType, $id ) : DOMElement
$doc DOMDocument
$workOrProduct string "Work" or "Product"
$idType string One of the O4DOI_ID_TYPE_* constants
$id string The ID.
return DOMElement
    function createIdentifierNode($doc, $workOrProduct, $idType, $id)
    {
        $deployment = $this->getDeployment();
        $productIdentifierNode = $doc->createElementNS($deployment->getNamespace(), "{$workOrProduct}Identifier");
        // ID type (mandatory)
        $productIdentifierNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), "{$workOrProduct}IDType", $idType));
        // ID (mandatory)
        $productIdentifierNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'IDValue', $id));
        return $productIdentifierNode;
    }