Allows to set a UUID to use for the node that will be created from this
NodeTemplate. Use with care, usually identifier generation should be left
to the ContentRepository.

@param string $identifier
@return void
@throws \InvalidArgumentException
161341
public function setIdentifier($identifier)
    {
        if (preg_match(NodeIdentifierValidator::PATTERN_MATCH_NODE_IDENTIFIER, $identifier) !== 1) {
            throw new \InvalidArgumentException(sprintf('Invalid UUID "%s" given.', $identifier), 1385026112);
        }
        $this->identifier = $identifier;
    }
275389
public function setResponseIdentifier($responseIdentifier)
    {
        if (is_string($responseIdentifier) === false || empty($responseIdentifier) === true) {
            throw new InvalidArgumentException(
                "The 'responseIdentifier' argument must be a non-empty string."
            );
        }
        
        $this->responseIdentifier = $responseIdentifier;
    }
171042
public function setID($identity)
    {
        $idAttribute = $this->idAttribute;
        return (is_string($idAttribute) && !empty($idAttribute)) ? $this->$idAttribute = $identity : null;
    }
1109026
private function guardValidIdentifier($identifier)
    {
        if (null === $identifier || '' === $identifier) {
            throw new ResolveComponentDataException('No resolved identifier given');
        }

        if (!is_scalar($identifier) && !is_array($identifier)) {
            throw new ResolveComponentDataException('Identifier has to be a scalar or an array');
        }
    }
828462
public static function setIdentifierName(string $identifier): void
    {
        if (empty($identifier)) {
            throw new InvalidArgumentException("Identifier shouldn't be empty.");
        } elseif (\in_array($identifier, ['password'])) {
            throw new InvalidArgumentException("Identifier [{$identifier}] is not allowed!");
        }

        static::$identifier = $identifier;
    }
569312
public function offsetUnset($identifier)
    {
        $keys = $this->_parseIdentifier($identifier);
        $last = count($keys)-1;
        $data =& $this->_data;

        foreach($keys as $index => $key)
        {
            if (!array_key_exists($key, $data)) {
                break;
            }

            if ($index < $last) {
                $data =& $data[$key];
            }
            else unset($data[$key]);
        }
    }
1139941
public function fetchByIdentifier($identifier) {
        if (!$identifier) {
            throw new InvalidArgumentException('Snippet identifier is required');
        }
        $select = $this->select()->where('identifier = ?', $identifier);
        if ($result = $this->fetchRow($select)) {
            return $result;
        }
        $ignoreMissing = Zend_Registry::get('config')->snippets->ignoreMissing ?? false;
        if (!$ignoreMissing) {
            throw new Exception('Snippet not found: ' . $identifier);
        }
        // Return fallback row, where text is set to $identifier, in order to provide some fallback.
        return $this->createRow([
            'has_text' => 1,
            'text' => $identifier,
        ]);
    }
485824
public function setIdentifier($identifier) {

		if(false === is_array($identifier)) {
			$identifier = [$identifier];
		}

		$this -> identifier = $identifier;
	}
914432
public function setUserName($userName)
    {
        $user = posix_getpwnam($userName);
        if (! isset($user['uid'])) {
            throw new InvalidArgumentException(sprintf('"%s" is not a valid user name', $userName));
        }

        $this->setUserId($user['uid']);
    }
692884
public function setByIdentifier($identifier, NodeInterface $node = null)
    {
        $this->nodesByIdentifier[$identifier] = $node;
        if ($node !== null) {
            $this->nodesByPath[$node->getPath()] = $node;
        }
    }
1360968
protected function setIdentifier($identifier)
    {
        if (Utils::isValidVariableIdentifier($identifier)) {
            $this->identifier = $identifier;
        } else {
            $msg = "The identifier '${identifier}' is not a valid QTI Variable Name Identifier.";
            throw new InvalidArgumentException($msg);
        }
    }
274229
public function add($identifier, $value)
    {
        if (array_key_exists($identifier, $this->variables)) {
            throw new InvalidVariableException('Duplicate variable declaration, "' . $identifier . '" already set!', 1224479063);
        }
        if (in_array(strtolower($identifier), self::$reservedVariableNames)) {
            throw new InvalidVariableException('"' . $identifier . '" is a reserved variable name and cannot be used as variable identifier.', 1256730379);
        }
        $this->variables[$identifier] = $value;
    }
1210760
public function setIdentifier($identifier)
    {
        if (Format::isIdentifier($identifier, false) === true) {
            $this->identifier = $identifier;
        } else {
            $msg = "The 'identifier' argument must be a valid QTI identifier, '" . $identifier . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
871515
public void setIdentifier(String identifier) {
        assertNotNull(identifier);
        this.identifier = identifier;
        setLength(identifier.length());
    }
30972
private function normalizeToPath($identifier)
    {
        if (UUIDHelper::isUUID($identifier)) {
            $identifier = $this->session->getNodeByIdentifier($identifier)->getPath();
        }

        return $identifier;
    }
835143
private function isNullIdentifier($identifier)
    {
        if (null === $identifier) {
            return true;
        }

        if ($identifier instanceof Traversable || is_array($identifier)) {
            $nonNullIdentifiers = array_filter(
                ArrayUtils::iteratorToArray($identifier),
                function ($value) {
                    return null !== $value;
                }
            );

            return empty($nonNullIdentifiers);
        }

        return false;
    }
1193547
public function searchTranslationUnit(string $identifier): ?XmlElement
    {
        if ('' === $identifier) {
            throw new \InvalidArgumentException('Empty Id passed.', 0);
        }

        if ($this->documentElement
            && $this->documentElement->isDefaultNamespace(self::XLIFF_NS)
            && $transUnit = $this->getXPathFirstItem(
                '/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit[@id=\'' . $identifier . '\']'
            )) {
            /** @var XmlElement $transUnit */
            return $transUnit;
        }

        if ($transUnit = $this->getXPathFirstItem(
            '/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit[@xlf:id=\'' . $identifier . '\']'
        )) {
            /** @var XmlElement $transUnit */
            return $transUnit;
        }

        return null;
    }