Register a class for an identifier

@param  KObjectIdentifier|string $identifier An ObjectIdentifier, identifier string
@param string $class The class
@return KObjectRegistry
502770
public function setClass($identifier, $class)
    {
        $class      = trim($class);
        $identifier = (string) $identifier;

        $this->_classes[$identifier] = $class;

        return $this;
    }
791865
public function registerJob($identifier, $callback)
    {
        if (array_key_exists($identifier, $this->identifierToId)) {
            $idNum = $this->identifierToId[$identifier];
        } else {
            $idNum = count($this->identifierToId) + 1;
            $this->idToIdentifier[$idNum] = $identifier;
        }
        $this->jobs[$identifier] = call_user_func(
            $callback,
            $idNum
        );
        $this->identifierToId[$identifier] = $idNum;
    }
966779
public function bindSingletonRuleToClass ($identifier, $className)
		{
			$this->classIndex->setRuleToClass($identifier, $className);

			$this->rules[$identifier] = new SingletonClassBindingRule($this, $this->classIndex, $className);

			return $this;
		}
355366
protected function _configure(KObjectIdentifier $identifier, array $data = array())
    {
        //Prevent config settings from being stored in the identifier
        $config = clone $identifier->getConfig();

        //Append the config data from the singleton
        if($identifier->getType() != 'lib' && $this->isSingleton($identifier))
        {
            $parts = $identifier->toArray();

            unset($parts['type']);
            unset($parts['domain']);
            unset($parts['package']);

            //Append the config from the singleton
            $config->append($this->getIdentifier($parts)->getConfig());
        }

        //Append the config data for the object
        $config->append($data);

        //Set the service container and identifier
        $config->object_manager    = $this;
        $config->object_identifier = $identifier;

        return $config;
    }
48966
public function addIdentifier($identifier)
    {
        if (!isset($this->identifiers[$identifier])) {
            $this->identifiers[$identifier] = $identifier;
        }

        return $this;
    }
289606
public function parseIdentifier(ObjectIdentifier $identifier)
    {
        $info = parent::parseIdentifier($identifier);

        $path  = $identifier->path;

        //Allow locating default classes if $path is empty.
        if(empty($path))
        {
            $info['path']    = $info['file'];
            $info['file']    = '';
            $info['package'] = '';
        }
        else
        {
            $package = array_shift($path);

            $info['path']    = StringInflector::implode($path);
            $info['package'] = ucfirst($package);
        }

        //Make an exception for 'view' and 'module' types
        if(in_array($info['package'], array('View','Module')) && !in_array('behavior', $path)) {
            $info['path'] = '';
        }

        return $info;
    }
1102050
public function set($identifier, $data = null)
    {
        if($data == null) {
            $data = is_string($identifier) ? new KObjectIdentifier($identifier) : $identifier;
        }

        $this->offsetSet((string) $identifier, $data);
        return $data;
    }
1053723
private function populateIdentifier(array $data, string $class): array
    {
        $identifier = $this->identifierExtractor->getIdentifierFromResourceClass($class);
        $identifier = null === $this->nameConverter ? $identifier : $this->nameConverter->normalize($identifier, $class, self::FORMAT);

        if (!isset($data['_source'][$identifier])) {
            $data['_source'][$identifier] = $data['_id'];
        }

        return $data;
    }
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();
        }
    }
906570
public function findAllByNotifiableQb($identifier, $class, $order = 'DESC')
    {
        return $this->createQueryBuilder('nn')
            ->addSelect('n')
            ->join('nn.notification', 'n')
            ->join('nn.notifiableEntity', 'ne')
            ->where('ne.identifier = :identifier')
            ->andWhere('ne.class = :class')
            ->orderBy('n.id', $order)
            ->setParameter('identifier', $identifier)
            ->setParameter('class', $class)
            ;
    }
310898
public function alias($identifier, $alias)
    {
        $alias      = trim((string) $alias);
        $identifier = (string) $identifier;

        //Don't register the alias if it's the same as the identifier
        if($alias != $identifier) {
            $this->_aliases[$alias] = (string) $identifier;
        }

        return $this;
    }
562695
public function getId($class, $identifier)
    {
        if (isset($this->fixtures[$class][$identifier])) {
            return $this->fixtures[$class][$identifier];
        } else {
            return false;
        }
    }
822965
protected function prepareFixture($class, $identifier, $data = array()) {
		if($class == 'File' || is_subclass_of($class, 'File')) {
			$data =  $this->prepareAsset($class, $identifier, $data);
		}
		return $data;
	}
358712
protected function _decorate(ObjectIdentifier $identifier, $delegate)
    {
        if ($delegate instanceof ObjectDecoratable)
        {
            $decorators = $identifier->getDecorators();

            foreach ($decorators as $key => $value)
            {
                if (is_numeric($key)) {
                    $delegate = $delegate->decorate($value);
                } else {
                    $delegate = $delegate->decorate($key, $value);
                }
            }
        }

        return $delegate;
    }
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);
    }
952176
public function addIdentifier(string $identifier)
    {
        $count = $this->queueRepository->countOpenByIdentifier($identifier);
        if ($count > 0) {
            return;
        }

        $this->logger->debug('SFC Queue add', [$identifier]);

        $data = [
            'cache_url' => $identifier,
            'page_uid' => 0,
            'invalid_date' => \time(),
            'call_result' => '',
        ];

        $this->queueRepository->insert($data);
    }
689857
protected function createClient($identifier)
    {
        if (!class_exists($identifier)) {
            return $this->createBuiltinClient($identifier);
        }

        return $this->createCustomClient($identifier);
    }