Retrieve the property display factory.

@throws RuntimeException If the property display factory was not previously set.
@return FactoryInterface
508171
public function propertyDisplayFactory()
    {
        if (!isset($this->propertyDisplayFactory)) {
            throw new RuntimeException(
                sprintf('Property Display Factory is not defined for "%s"', get_class($this))
            );
        }

        return $this->propertyDisplayFactory;
    }
1360072
public function sectionFactory()
    {
        if (!isset($this->sectionFactory)) {
            throw new RuntimeException(
                sprintf('Section Model Factory is not defined for "%s"', get_class($this))
            );
        }

        return $this->sectionFactory;
    }
391994
public function getActiveProvider()
    {
        if ($this->activeProvider instanceof ProviderInterface) {
            return $this->activeProvider;
        }

        if (empty($this->providers)) {
            throw new RuntimeException('No versioning provider found');
        }

        foreach ($this->providers as $entry) {
            $provider = $entry['provider'];
            /** @var $provider ProviderInterface */
            if ($provider->isSupported()) {
                $this->activeProvider = $provider;

                return $provider;
            }
        }

        throw new RuntimeException('No supported versioning providers found');
    }
846300
private static function getFactory(string $type)
    {
        if (!empty(self::$factories[$type])) {
            return self::$factories[$type];
        }

        if (!empty(self::$factory)) {
            return self::$factories[$type] = self::$factory;
        }

        foreach (self::$strategies as $className) {
            if (is_array($className) && isset($className[$type])) {
                $className = $className[$type];

                if (class_exists($className)) {
                    return self::$factories[$type] = new $className();
                }

                continue;
            }

            if (!class_exists($className)) {
                continue;
            }

            if (strpos($className, __NAMESPACE__) === 0 && !$className::isInstalled()) {
                continue;
            }

            return self::$factories[$type] = self::$factory = new $className();
        }

        throw new RuntimeException('No PSR-7 library detected');
    }
928057
public function eventFactory()
    {
        if (null !== $this->eventPrototype) {
            return clone $this->eventPrototype;
        }

        try {
            /** @var ModuleOptions $moduleOptions */
            $moduleOptions = $this->get(ModuleOptions::class);

            $moduleOptionsEventClassName = $moduleOptions->getModuleOptionsEventClassName();
            $r = new ReflectionClass($moduleOptionsEventClassName);

            $eventPrototype = $r->newInstance();
            if (!$eventPrototype instanceof EventInterface) {
                $errMsg = sprintf(
                    'Event of type %s is invalid; must implement %s',
                    (is_object($eventPrototype) ? get_class($eventPrototype) : gettype($eventPrototype)),
                    ModuleOptionsEventInterface::class
                );
                throw new Exception\RuntimeException($errMsg);
            }
            $this->eventPrototype = $eventPrototype;
        } catch (\Exception $e) {
            throw new Exception\InvalidEventException($e->getMessage(), $e->getCode(), $e);
        }

        return clone $this->eventPrototype;
    }
1307736
protected function getContainer()
    {
        if ($this->innerContainer instanceof ContainerInterface) {
            // Do nothing
        } elseif (!is_readable($this->innerContainer)) {
            throw new RuntimeException(
                sprintf(
                    "Unable to read file %s\n",
                    $this->innerContainer
                )
            );
        } else {
            // 'containerBuilder.php' file expects $installDir variable to be set by caller
            $installDir = $this->installDir;
            $this->innerContainer = require_once $this->innerContainer;
        }

        // Compile container if necessary
        if ($this->innerContainer instanceof ContainerBuilder && !$this->innerContainer->isFrozen()) {
            $this->innerContainer->compile();
        }
    }
1221016
public function getLoggersFactory() {
		if ($this->_loggersFactory !== null) {
			return $this->_loggersFactory;
		}
		
		if (! $this instanceof LocatorAwareInterface) {
			throw new NoFactory('Neither a service\'s locator nor loggers\' factory has been specified');
		}

		if ($this->hasLocator()) {
			$this->_loggersFactory = $this->getLocator()->get($this->getLoggersFactoryServiceId());
			
			if (! $this->_loggersFactory instanceof FactoryInterface) {
				throw new NoFactory('Factory must implement the "LoggerInterface"');
			}
		} else {
			throw new NoFactory('Neither a logger\'s factory nor a locator has been specified');
		}
		
		return $this->_loggersFactory;
	}
140929
public function getResolver()
    {
        if ($this->resolver === null) {
            $config = $this->getConfig('resolver');
            if ($config !== null) {
                $this->resolver = $this->buildResolver($config);
            } else {
                throw new RuntimeException('Resolver has not been set.');
            }
        }

        return $this->resolver;
    }
586194
protected function structureModelFactory()
    {
        if (!isset($this->structureModelFactory)) {
            throw new RuntimeException(sprintf(
                'Model Factory is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->structureModelFactory;
    }
1291319
protected function resolveFactory(string $factory_class) : FactoryInterface {
    // If the requested factory is the default.
    if ($this->factoryClass == $factory_class) {
      // If we've not yet instantiated the default.
      if (empty($this->factory)) {
        $this->factory = $this->factoryResolver->getFactoryInstance($this->factoryClass);
      }
      // Return the default.
      return $this->factory;
    }
    // If the requested factory is NOT the default.
    return $this->factoryResolver->getFactoryInstance($factory_class);
  }
378259
public static function getInstance()
    {
        if (is_null(self::$instance)) {
            throw new \RuntimeException('You must first create the singleton instance with createInstance().');
        }
        self::$instance->setGlobalsFromSugar();
        self::$instance->chdirToSugarDir();

        return self::$instance;
    }
614250
public function collectionLoaderFactory()
    {
        if (!isset($this->collectionLoaderFactory)) {
            throw new RuntimeException(sprintf(
                'Collection Loader Factory is not defined for [%s]',
                get_class($this)
            ));
        }

        return $this->collectionLoaderFactory;
    }
341499
public function getServiceUtil()
    {
        if ($this->serviceUtil) {
            return $this->serviceUtil;
        }

        $className = $this->getServiceUtilClassName();
        $r = new ReflectionClass($className);
        $instance = $r->newInstance();

        if (!$instance instanceof ServiceUtilInterface) {
            $errMsg = sprintf('Service util not implement %s', ServiceUtilInterface::class);
            throw new Exception\RuntimeException($errMsg);
        }
        $this->serviceUtil = $instance;

        return $this->serviceUtil;
    }
449507
protected function getViewHelperFactory()
    {
        $factory = $this->getPrototype(
                $this->viewHelperFactoryClass,
                ['umi\templating\extension\helper\IHelperFactory']
            )
            ->createInstance();

        if ($factory instanceof IModelAware && $this->modelFactory) {
            $factory->setModelFactory($this->modelFactory);
        }

        return $factory;
    }
1089620
private function getNettePresenterFactory(): Nette\DI\Definitions\ServiceDefinition
    {
        $applicationExtension = $this->compiler->getExtensions(Nette\Bridges\ApplicationDI\ApplicationExtension::class);
        if ($applicationExtension === []) {
            throw new \LogicException('ApplicationExtension not found, did you register it in your configuration?');
        }

        $container = $this->getContainerBuilder();
        $presenterFactory = reset($applicationExtension)->prefix('presenterFactory');
        if (!$container->hasDefinition($presenterFactory)) {
            throw new \LogicException('PresenterFactory service from ApplicationExtension not found. Make sure ApplicationExtension is loaded before PresenterMappingExtension.');
        }

        /** @var Nette\DI\Definitions\ServiceDefinition $serviceDefinition */
        $serviceDefinition = $container->getDefinition($presenterFactory);

        return $serviceDefinition;
    }
1181677
public function display()
    {
        if ($this->displayProperty === null) {
            $this->displayProperty = $this->createDisplayProperty();
        }

        return $this->displayProperty;
    }
684269
public function templateProperty()
    {
        if ($this->templateProperty === null) {
            $obj = $this->obj();
            if ($obj instanceof TemplateableInterface) {
                $this->setTemplateProperty($obj->property('template_ident'));
            } else {
                throw new RuntimeException(sprintf(
                    'Storage property owner is not defined for "%s"',
                    get_class($this)
                ));
            }
        }

        return $this->templateProperty;
    }