Assign identifier to object.

@param object  $object
@param mixed[] $identifier
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);
    }
172526
public function set($identifier, $value) {
		$this->arraySet(self::$_data, '_session_class._standard.' . $this->section . '.' . $identifier, $value);
	}
144291
public function isObject(DataObject $object, $name)
    {
        $identifier = ltrim($name, '->');
        
        return ($this->isObjectIdentifier($name) && is_object($object->$identifier));
    }
550781
protected function _mixin(ObjectIdentifier $identifier, $mixer)
    {
        if ($mixer instanceof ObjectMixable)
        {
            $mixins = $identifier->getMixins();

            foreach ($mixins as $key => $value)
            {
                if (is_numeric($key)) {
                    $mixer->mixin($value);
                } else {
                    $mixer->mixin($key, $value);
                }
            }
        }

        return $mixer;
    }
1355181
public function registerManaged($document, $identifier, array $data)
    {
        $oid                              = spl_object_hash($document);
        $this->documentIdentifiers[$oid]  = $identifier !== null ? $identifier : $oid;
        $this->documentStates[$oid]       = self::STATE_MANAGED;
        $this->originalDocumentData[$oid] = $data;
        $this->addToIdentityMap($document);
    }
747919
protected function updateByIdentifier($identifier, $data)
	{
		return $this->aggregate[IdentifierServiceProvider::getProviderKey()]->update($identifier->getEntity(), $data);
	}
345266
public function set($object, $id = null)
    {
        if (is_array($object)) {
            return $this->setAll($object);
        }

        $this->objects[$object] = $id;
    }
92590
public function unregisterObject($object)
    {
        unset($this->identifierMap[$this->objectMap[$object]]);
        $this->objectMap->detach($object);
    }
1220258
public function persist(IdentifiableObject $object): void
    {
        $id = (string)$object->id();

        $allData = $this->loadAllObjects();
        $allData[$id] = $object;
        $this->saveAllObjects($allData);

        stdout(line(make_cyan('Persisted'), get_class($object), ':', $id));
    }
812234
protected function arrayContainsObject(array $array, $object, $identifier)
    {
        if (in_array($object, $array, true) === true) {
            return true;
        }

        foreach ($array as $value) {
            if ($value instanceof $object && $this->persistenceSession->getIdentifierByObject($value) === $identifier) {
                return true;
            }
        }

        return false;
    }
1120507
public function fromResource($object, ResourceObject $resource)
    {
        $context = $this->createContext(get_class($object));

        $this->identifierHandler->setIdentifier($object, $resource->getId(), $context);

        foreach ($this->handlers as $handler)
        {
            $handler->fromResource($object, $resource, $context);
        }
    }
877777
protected static function setIdentifier($field, $identifier, $defaultIdentifier)
    {
        if ($identifier === null) {
            $identifier = new $defaultIdentifier();
        }

        if (!($identifier instanceof Identifier)) {
            throw new \InvalidArgumentException('$identifier must be instance of Identifier');
        }

        static::${$field} = $identifier;
    }
566304
public function init($identifier, $slug)
    {
        $this->getModel()->setId($identifier);
        $this->getModel()->setSlug($slug);

        $this->addMetabox();
    }
1004799
public function addFixture($object, $identifier)
    {
        if (!isset($this->fixtures[get_class($object)])) {
            $this->fixtures[get_class($object)] = [];
        }
        
        $this->fixtures[get_class($object)][$identifier] = $object->ID;
    }
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;
    }
276605
public function registerObject($object, $identifier)
    {
        $this->objectMap[$object] = $identifier;
        $this->identifierMap[$identifier] = $object;
    }
864730
public static function set($identifier, $value)
    {
        list($hash, $keys) = self::_parseIdentifier($identifier);

        // Add to _REQUEST hash if original hash is get, post, or cookies
        if (in_array($hash, array('GET', 'POST', 'COOKIE'))) {
            self::set('request.'.implode('.', $keys), $value);
        }

        // Store cookies persistently
        if ($hash == 'COOKIE' && strpos(AnRequest::scheme(), 'http') !== false) {
            // rewrite the $keys as foo[bar][bar]
            $ckeys = $keys; // get a copy
            $name = array_shift($ckeys);
            foreach ($ckeys as $ckey) {
                $name .= '['.$ckey.']';
            }

            if (! setcookie($name, $value)) {
                throw new AnRequestException("Couldn't set cookie, headers already sent.");
            }
        }

        // Store in $GLOBALS
        foreach (array_reverse($keys, true) as $key) {
            $value = array($key => $value);
        }

        // Add the global if it's doesn't exist
        if (! isset($GLOBALS['_'.$hash])) {
            $GLOBALS['_'.$hash] = array();
        }

        $GLOBALS['_'.$hash] = AnHelperArray::merge($GLOBALS['_'.$hash], $value);
    }