Внедряет зависимости от контекста в фабрику расширений
шаблонизатора.
@param IViewExtensionFactory $factory
11094
protected function injectContextToViewExtensionFactory(IViewExtensionFactory $factory)
    {
        if ($factory instanceof IContextAware) {
            $factory->clearContext();

            if ($this->hasContext()) {
                $factory->setContext($this->getContext());
            }
        }

        if ($factory instanceof IModelAware && $this->modelFactory) {
            $factory->setModelFactory($this->modelFactory);
        }
    }
1152532
private function implementsPoviderFactory($factoryClass): bool
    {
        if (false === $interfaces = class_implements($factoryClass)) {
            return false;
        }

        return in_array(ProviderFactoryInterface::class, $interfaces);
    }
296346
public function getRepositoryFactory(): RepositoryFactoryInterface
    {
        if (null !== $this->repositoryFactory) {
            return $this->repositoryFactory;
        }

        $factory = new DefaultRepositoryFactory();
        $factory->setDefaultRepositoryClassName($this->getDefaultRepositoryClassName());

        return $factory;
    }
1340359
public function setMigrationFactory(FactoryInterface $factory)
    {
        foreach ($this->getRepositories() as $repo) {
            $repo->setMigrationFactory($factory);
        }
    }
47455
public function register(callable $factory): self
    {
        $this->data->register($factory, $this->crtPriority);
        return $this;
    }
598181
protected function prepareFactory()
    {
        if (empty($this->componentFactory) && isset($this->configuration)) {
            $this->componentFactory = new ComponentFactory($this->configuration);
        }
    }
962536
public function contextFactory(ContextFactory $instance = null, array $contexts = [])
    {
        if ($instance === null) {
            if ($this->_contextFactory === null) {
                $this->_contextFactory = ContextFactory::createWithDefaults($contexts);
            }

            return $this->_contextFactory;
        }
        $this->_contextFactory = $instance;

        return $this->_contextFactory;
    }
784555
public function addFactory(PaginatedCollectionRequestFactoryInterface $factory, $priority = 0)
    {
        $this->factories[$priority][] = $factory;

        unset($this->sorted);
    }
1065679
public function match($source, TokenFactoryInterface $factory)
    {
        yield $factory->create(Token::NAME, ['pos' => 0, 'length' => strlen($source)]);
    }
779010
private function register(EntityFactoryInterface $factory): self
    {
        $this->mapping = $this->mapping->put(
            get_class($factory),
            $factory
        );

        return $this;
    }
1334306
protected static function factory($factory)
    {
        if (is_callable($factory)) {
            return $factory();
        }

        $type = gettype($factory);
        if ($type == 'string' && count(EventManager::instance()->listeners($factory)) > 0) {
            return EventManager::instance()->dispatch($factory)->result;
        }

        throw new \InvalidArgumentException('No suitable factory found');
    }
77132
public function add(FactoryInterface $factory, $before = null)
    {
        $pos = null;

        if ($before) {
            foreach ($this->factories as $i => $f) {
                if ($before instanceof FactoryInterface) {
                    if ($f === $before) {
                        $pos = $i;
                        break;
                    }
                } elseif (is_string($before)) {
                    if ($f instanceof $before) {
                        $pos = $i;
                        break;
                    }
                }
            }
        }

        if ($pos === null) {
            $this->factories[] = $factory;
        } else {
            array_splice($this->factories, $i, 0, array($factory));
        }

        return $this;
    }
414988
public static function SetFactory($Factory, $Override = TRUE) {
      if ($Override || is_null(self::$_Factory))
         self::$_Factory = $Factory;
   }
263736
public void addMessageSelectorFactory(MessageSelectorFactory<?> factory) {
        if (factory instanceof BeanFactoryAware) {
            ((BeanFactoryAware) factory).setBeanFactory(beanFactory);
        }

        this.factories.add(factory);
    }
446630
public function addTo(Extendable $factory)
    {
        foreach ($this->aliases as $typeName => $rules) {
            foreach ($rules as $alias => $rule) {
                $factory->extend($alias, [$this, 'toType']);
            }
        }
    }
934995
private final function getViewExtensionFactory()
    {
        if (!$this->_viewExtensionFactory) {
            throw new RequiredDependencyException(sprintf(
                'View extension factory is not injected in class "%s".',
                __CLASS__
            ));
        }

        $this->injectContextToViewExtensionFactory($this->_viewExtensionFactory);

        return $this->_viewExtensionFactory;
    }
216501
public final void setEntryFactory(Callback<CreateEntryParameter, Entry<?>> factory) {
        Objects.requireNonNull(factory);
        entryFactoryProperty().set(factory);
    }