Set the identifier on which the validity constraint applies to.

@param integer $identifier
@throws \InvalidArgumentException If $identifier is an empty string.
505951
public function setIdentifier($identifier)
    {
        if (is_string($identifier) === false || empty($identifier) === true) {
            throw new InvalidArgumentException(
                "The 'identifier' argument must be a non-empty string."
            );
        }
        
        $this->identifier = $identifier;
    }
310269
public function setSectionIdentifier($sectionIdentifier)
    {
        if (Format::isIdentifier($sectionIdentifier) || empty($sectionIdentifier)) {
            $this->sectionIdentifier = $sectionIdentifier;
        } else {
            $msg = "'${sectionIndentifier}' is not a valid QTI Identifier.";
            throw new InvalidArgumentException($msg);
        }
    }
330150
public function assignIdentifier($object, array $identifier) : void
    {
        if (! $object instanceof IdentifiableInterface) {
            throw new InvalidArgumentException(sprintf('%s must implement IdentifiableInterface.', get_class($object)));
        }

        $object->assignIdentifier($identifier);
    }
1346658
public function setOutcomeIdentifier($outcomeIdentifier)
    {
        if (Format::isIdentifier($outcomeIdentifier, false) === true) {
            $this->outcomeIdentifier = $outcomeIdentifier;
        } else {
            $msg = "The 'outcomeIdentifier' argument must be a valid QTI identifier, '" . $outcomeIdentifier . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
545141
public function isValidEntryIdentifier($identifier)
    {
        if (false === GeneralUtility::isValidUrl($identifier)) {
            return false;
        }
        $urlParts = \parse_url($identifier);
        $required = ['host', 'path', 'scheme'];
        foreach ($required as $item) {
            if (!isset($urlParts[$item]) || \mb_strlen($urlParts[$item]) <= 0) {
                return false;
            }
        }

        return true;
    }
253805
public function setOutcomeIdentifier($outcomeIdentifier)
    {
        if (Format::isIdentifier($outcomeIdentifier)) {
            $this->outcomeIdentifier = $outcomeIdentifier;
        } else {
            $msg = "'${outcomeIdentifier}' is not a valid QTI Identifier.";
            throw new InvalidArgumentException($msg);
        }
    }
877460
private function _validateId($identifier = null, $identifierType = 'token')
    {
        if (empty($identifier)) {
           throw new InvalidArgumentException(
                   'expected paypal account id to be set'
                   );
        }
        if (!preg_match('/^[0-9A-Za-z_-]+$/', $identifier)) {
            throw new InvalidArgumentException(
                    $identifier . ' is an invalid paypal account ' . $identifierType . '.'
                    );
        }
    }
175903
public function identifyEntity(ModelInterface $model, &$entity, $identifier)
    {
        $primaryKeys = $model->primaryFields();
        if (count($primaryKeys) !== 1) {
            return;
        }

        $field = reset($primaryKeys)->name();

        $this->setPropertyValue($entity, $field, $identifier);
    }
7260
public function ensureContentTypeDoesntExist($identifier)
    {
        $contentType = $this->loadContentTypeByIdentifier($identifier, false);
        if ($contentType) {
            $this->removeContentType($contentType);
        }
    }
1057339
public function offsetSet($offset, $identifier)
    {
        if($identifier instanceof ObjectIdentifierInterface)
        {
            $data = array(
                'identifier' =>  $identifier,
                'class'      =>  $this->getClass($identifier)
            );

            apc_store($this->getNamespace().'-object_'.$offset, $data);
        }

        parent::offsetSet($offset, $identifier);
    }
316877
public function setIdentifier($value)
    {
        if ($value !== null && ($value < 0 || $value > 0xFFFF)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Expected an identifier between 0x0000 and 0xFFFF but got %x',
                    $value
                )
            );
        }

        $this->identifier = $value;
    }
1179971
public function setId($id)
    {
        // blacklist
        if (!(is_string($id) and filter_var($id, \FILTER_VALIDATE_INT) !== false)
        and !is_int($id)) {
            throw new \InvalidArgumentException( "Integer ID expected." );
        }

        $this->id = (int) trim($id);

        return $this;
    }
815288
public function setAssignmentForIdentifier($identifier, $access = null)
    {
        if (is_array($identifier)) {
            foreach ($identifier as $identifier => $access) {
                $this->setAssignmentForIdentifier($identifier, $access);
            }
        } else {
            //not a real identifier just the
            //the name part.
            //we need to infer the whole identifier
            //com:[pluralized name].domain.entity.[name]

            if (strpos($identifier, '.') === false) {
                $identifier = 'com:'.AnInflector::pluralize($identifier).'.domain.entity.'.$identifier;
            }

            $assignment = $this->assignments->findOrAddNew(array('actortype' => $identifier));

            $assignment->access = $access;
        }
    }
997142
public function identifier($identifier = null)
    {
        if (null === $identifier) {
            return $this->identifier;
        }

        $this->identifier = $identifier;
        return $this;
    }
985710
public function setTemplateIdentifier($templateIdentifier)
    {
        if (!is_string($templateIdentifier) && !$templateIdentifier instanceof \Closure) {
            throw new InvalidArgumentType('templateIdentifier', 'string or \Closure', $templateIdentifier);
        }

        $this->templateIdentifier = $templateIdentifier;
    }
999468
protected static function getRatingByStringIdentifier(string $identifier): int
    {
        switch ($identifier) {
            case 's':
                return PostInterface::RATING_SAFE;

            case 'q':
                return PostInterface::RATING_QUESTIONABLE;

            case 'e':
                return PostInterface::RATING_EXPLICIT;

            default:
                throw new InvalidArgumentException('Unknown rating identifier');
        }
    }
692884
public function setByIdentifier($identifier, NodeInterface $node = null)
    {
        $this->nodesByIdentifier[$identifier] = $node;
        if ($node !== null) {
            $this->nodesByPath[$node->getPath()] = $node;
        }
    }