@param string   $identifier
@param callable $rule
@param bool     $singleton

@returns self
@throws DependencyException
498199
public function setRule ($identifier, callable $rule, $singleton = false)
		{
			if (! is_bool($singleton)) {
				throw new DependencyException('The singleton parameter must be boolean.');
			}

			if ($singleton) {
				$this->setSingletonRule($identifier, $rule);
			} else {
				$this->rules[$identifier] = new CallbackRule($this, $rule);
			}

			return $this;
		}
1144993
public function tryGetByIdentifier(Identifier $identifier)
    {
        $mapId     = $identifier->getSerialized();
        $className = $identifier->class->getName();

        if (!isset($this->identityMap[$className][$mapId])) {
            return false;
        }

        return $this->identityMap[$className][$mapId];
    }
56720
public function getConfigurationObjectForIdentifier(string $identifier): ObjectInterface
    {
        if (isset($this->identifiers[$identifier]) === true) {
            return $this->identifiers[$identifier];
        }

        return new Blackhole();
    }
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);
        }
    }
1046796
protected function setIdentifier(
        $field,
        $identifier,
        $default = null
    )
    {
        if ($default && $identifier === null) {
            $identifier = call_user_func($default);
        }

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

        $this->{$field} = $identifier;
    }
638253
protected function cacheViaTrait(string $entryIdentifier, callable $callback, string $cacheIdentifier, int $lifetime = 0, array $tags = [])
    {
        try {
            /** @var AbstractFrontend $cache */
            $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache($cacheIdentifier);
        } catch (\Exception $ex) {
            $logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
            $logger->error($ex->getMessage(), ['entryIdentifier' => $entryIdentifier, 'cacheIdentifier' => $cacheIdentifier]);

            return \call_user_func_array($callback, []);
        }

        // Do not use "has" because the cache is a shared resource
        $result = $cache->get($entryIdentifier);
        if (false !== $result) {
            return $result;
        }
        $result = \call_user_func_array($callback, []);
        $cache->set($entryIdentifier, $result, $tags, 0 === $lifetime ? null : $lifetime);

        return $result;
    }
697930
public function getForm($identifier, $instance) {
		$form = $this->jquery->semantic ()->dataForm ( $identifier, $instance );
		$form->setLibraryId ( "frmEdit" );
		$className = \get_class ( $instance );
		$fields = $this->controller->_getAdminData ()->getFormFieldNames ( $className, $instance );
		$relFields = OrmUtils::getFieldsInRelations_ ( $className );

		$this->setFormFields_ ( $fields, $relFields );
		array_unshift ( $fields, "_message" );
		$form->setFields ( $fields );

		$fieldTypes = OrmUtils::getFieldTypes ( $className );
		$this->setFormFieldsComponent ( $form, $fieldTypes );
		$this->relationMembersInForm ( $form, $instance, $className, $fields, $relFields );
		OrmUtils::setFieldToMemberNames ( $fields, $relFields );
		$form->setCaptions ( $this->getFormCaptions ( $fields, $className, $instance ) );
		$message = $this->getFormTitle ( $form, $instance );
		$form->setCaption ( "_message", $message ["subMessage"] );
		$form->fieldAsMessage ( "_message", [ "icon" => $message ["icon"] ] );
		$instance->_message = $message ["message"];
		$form->setSubmitParams ( $this->controller->_getBaseRoute () . "/update", "#frm-add-update" );
		$form->onGenerateField ( [ $this,'onGenerateFormField' ] );
		return $form;
	}
813589
public function getClient($identifier)
    {
        $client = $this->getClientFromPool($identifier);

        if ($client === null) {
            $client = $this->createClient($identifier);
            $this->getSession()->registerClient($client);
        }

        return $client;
    }
435430
public function withIdentifier(bool $identifier): self
    {
        $metadata = clone $this;
        $metadata->identifier = $identifier;

        return $metadata;
    }
929411
public function start($identifier = null, $force = false)
    {
        if ($this->currentImport instanceof Import) {
            throw new Exception('Unable to start a new import, please stop the current import first', 1426638560);
        }

        if ($identifier !== null) {
            $existingImport = $this->importRepository->findOneByExternalImportIdentifier($identifier);
            if (!$force  && $existingImport instanceof Import) {
                throw new ImportAlreadyExecutedException(sprintf('An import referring to the external identifier "%s" has already been executed on %s.', $identifier, $existingImport->getStartTime()->format('d.m.Y h:m:s')), 1464028408403);
            }
        }

        $this->currentImport = new Import();
        $this->currentImport->setExternalImportIdentifier($identifier);

        if ($force && isset($existingImport)) {
            $this->addEventMessage(sprintf('ImportService:start', 'Forcing re-import of data set with external identifier "%s".', $identifier), LOG_NOTICE);
        }

        $this->importRepository->add($this->currentImport);
        $this->persistenceManager->persistAll();
    }
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);
        }
    }
592411
public static function getComponentWithIdentifier(string $identifier)
    {
        $components = self::getComponents();
        foreach ($components as $component) {
            if (empty($component->getIdentifier())) {
                continue;
            }
            
            if ($component->getIdentifier() == $identifier) {
                return $component;
            }
        }
        
        return null;
    }
48966
public function addIdentifier($identifier)
    {
        if (!isset($this->identifiers[$identifier])) {
            $this->identifiers[$identifier] = $identifier;
        }

        return $this;
    }
873090
public function getObject ($identifier, array $parameters = array())
		{
			if (! isset($this->rules[$identifier])) {
				throw new DependencyException('Unknown object or rule ' . var_export($identifier, true) . '.');
			}

			$rule = $this->rules[$identifier];

			return $rule->resolve($parameters);
		}
719497
public static function getAddonHavingComponentWithIdentifier(string $identifier)
    {
        $addons = self::getAddons();
        foreach ($addons as $addon) {
            foreach ($addon->getComponents() as $component) {
                if (empty($component->getIdentifier())) {
                    continue;
                }
                
                if ($component->getIdentifier() == $identifier) {
                    return $addon;
                }
            }
        }
        
        return null;
    }
757998
public function setIdentifier($identifier)
    {
        if ($this->identifier && $this->identifier !== $identifier) {
            throw new MappingException('Cannot map the identifier to more than one property');
        }

        $this->identifier = $identifier;
    }
236390
public function read(int $identifier): ?TokenInterface
    {
        try {
            return $this->readResource($identifier);
        } catch (RepositoryException $exception) {
            $message = 'Token reading failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }