Registers an identifier to facilitate searching.

@param string $id ID for the cache item
@param array $attributes Attributes for the cache item
@param string $identifier Identifier generated for the cache item
165949
protected function registerIdentifier( $id = null, $attributes = array(), $identifier = null )
    {
        $identifier = ( $identifier !== null ) ? $identifier : $this->generateIdentifier( $id, $attributes );
        $location = $this->properties['location'];

        $this->fetchSearchRegistry();

        // Makes sure the identifier exists
        if ( !isset( $this->searchRegistry[$location][$id][$identifier] ) )
        {
            // Makes sure the id exists
            if ( !isset( $this->searchRegistry[$location][$id] )
                 || !is_array( $this->searchRegistry[$location][$id] ) )
            {
                $this->searchRegistry[$location][$id] = array();
            }

            $this->searchRegistry[$location][$id][$identifier] = new ezcCacheStorageMemoryRegisterStruct( $id, $attributes, $identifier, $location );
            $this->storeSearchRegistry();
        }
    }
883583
public function setIdentifier($entity, array $id) : void
    {
        foreach ($id as $idField => $idValue) {
            $property = $this->class->getProperty($idField);

            $property->setValue($entity, $idValue);
        }
    }
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;
    }
576685
public function findByIdentifier($identifier) {
		$accessTokenResult = $this->cache->get($identifier);
		if ($accessTokenResult instanceof AccessToken) {
			return $accessTokenResult;
		}
		return NULL;
	}
780051
@Override
    public boolean registerIdentification(Identifiable identifiable) {
        if (identifiable == null || identifiable.getID() == null || identifiable.getID().isEmpty()) return false;
        if (registered.containsValue(identifiable) || registered.containsKey(identifiable.getID())) {
            return false;
        }
        registered.put(identifiable.getID(), identifiable);
        return true;
    }
627550
public function update(array $attributes = [], $id = null)
    {
        // This allows for update based on the primary key
        if ($id && $this->exists === false) {
            $this->setAttribute($this->getKeyName(), $id);
            $this->exists = true;
        }

        $this->syncOriginal();

        return $this->fill($attributes)->save();
    }
871515
public void setIdentifier(String identifier) {
        assertNotNull(identifier);
        this.identifier = identifier;
        setLength(identifier.length());
    }
387571
public function retrieveByID($identifier)
	{
		$result = @ldap_read($this->conn, $identifier, '(objectclass=*)', $this->config['attributes']);
		if ($result === FALSE)
			return null;

		$entries = ldap_get_entries($this->conn, $result);
		if ($entries['count'] == 0 || $entries['count'] > 1)
			return null;

		return $this->clean($entries[0]);
	}
862934
public function refresh(Identifier $identifier, $document)
    {
        $qb    = $this->dm->createQueryBuilder($this->class->name);
        $query = $qb->get()->setIdentifier($identifier)->getQuery();
        $data  = $query->getSingleMarshalledResult();
        $data  = $this->hydratorFactory->hydrate($document, $data);

        $this->uow->setOriginalDocumentData($document, $data);
    }
269726
public function initialize($attributes, $id = null)
    {
        if ($this->started) {
            return $this;
        }
        
        $this->id = $id ?: $this->id;
        $this->attributes = $attributes;
        $this->started = true;
        
        return $this;
    }
543460
private function prepareReferencedDocumentValue(PropertyMetadata $mapping, Identifier $identifier)
    {
        $hashKey            = $identifier->getHashKey();
        $hashType           = $hashKey->getType();
        $hashIndex          = $mapping->isStoreAsMap() ? $hashKey->getPropertyMetadata()->attributeName : 0;
        $return[$hashIndex] = $hashType->convertToDatabaseValue($identifier->getHashValue(), false);

        if ($identifier->isComposite()) {
            $rangeKey            = $identifier->getRangeKey();
            $rangeType           = $rangeKey->getType();
            $rangeIndex          = $mapping->isStoreAsMap() ? $rangeKey->getPropertyMetadata()->attributeName : 1;
            $return[$rangeIndex] = $rangeType->convertToDatabaseValue($identifier->getRangeValue(), false);
        }

        if ($mapping->targetDocument === null) {
            //add the discriminator value (if necessary)
            $discriminatorIndex = $mapping->isStoreAsMap() ? $mapping->discriminatorAttribute : count($return) + 1;
            $className          = $identifier->class->getName();

            //use discriminator map value if one exists
            if ($mapping->discriminatorMap !== null) {
                $discriminator = array_search($className, $mapping->discriminatorMap);

                if ($discriminator === false) {
                    unset($discriminator);
                }
            }

            //otherwise the FQCN is the discriminator
            if (!isset($discriminator)) {
                $discriminator = $className;
            }

            //only store if its not the same as the default
            if ($discriminator !== $mapping->discriminatorDefaultValue) {
                $return[$discriminatorIndex] = $discriminator;
            }
        }

        if ($mapping->isStoreAsJson()) {
            $return = json_encode($return);
        }

        return $mapping->getSerializationType()->convertToDatabaseValue($return);
    }
948303
public function isRegistered($identifier)
    {
        if (!parent::isRegistered($identifier)) {

            $this->load();

            return parent::isRegistered($identifier);
        }

        return true;
    }
1317756
private function _registerTag($id, $tag) {
        $res = $this->_query("DELETE FROM TAG WHERE name='$tag' AND id='$id'");
        $res = $this->_query("INSERT INTO tag (name, id) VALUES ('$tag', '$id')");
        if (!$res) {
            $this->_log("Zend_Cache_Backend_Sqlite::_registerTag() : impossible to register tag=$tag on id=$id");
            return false;
        }
        return true;
    }
1340970
protected function match($row, $identifier)
    {
        foreach ($identifier as $key => $value) {
            if ($row[$key] != $value) {
                return false;
            }
        }

        return true;
    }
563921
public function setCacheableIdentifier(string $id = null, int $length = null): self
    {
        if ($id) {
            if (!preg_match('/^[a-zA-Z0-9\_\-\~\.]{8,32}$/', $id)) {
                throw new CacheException('Invalid value passed to "setCacheableIdentifier" method');
            }

            $this->cacheableId = $id;
            $this->cacheableIdLength = strlen($id);
        }

        if ($length) {
            if ($length < 100 || $length <= $this->cacheableIdLength) {
                throw new CacheException('Length of encoded Cacheable objects must start from at least 100');
            }

            $this->cacheableLengthFrom = $length;
        }

        return $this;
    }
817996
public function node($id, array $attributes = array())
    {
        $this->instructions[] = new Node($id, $attributes, $this);

        return $this;
    }
501721
public function hasCache(string $identifier): bool
    {
        return isset($this->caches[$identifier]) || isset($this->cacheConfigurations[$identifier]);
    }