Retrieve the model collection loader.

@throws RuntimeException If the collection loader was not previously set.
@return CollectionLoader
7359
protected function collectionLoader()
    {
        if ($this->collectionLoader === null) {
            throw new RuntimeException(sprintf(
                'Collection Loader is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->collectionLoader;
    }
414233
protected function _getUrlChecker()
    {
        $options = $this->getConfig('urlChecker');
        if (!is_array($options)) {
            $options = [
                'className' => $options
            ];
        }
        if (!isset($options['className'])) {
            $options['className'] = DefaultUrlChecker::class;
        }

        $className = App::className($options['className'], 'UrlChecker', 'UrlChecker');
        if ($className === false) {
            throw new RuntimeException(sprintf('URL checker class `%s` was not found.', $options['className']));
        }

        $checker = new $className();

        if (!($checker instanceof UrlCheckerInterface)) {
            throw new RuntimeException(sprintf(
                'The provided URL checker class `%s` does not implement the `%s` interface.',
                $options['className'],
                UrlCheckerInterface::class
            ));
        }

        return $checker;
    }
664156
protected function loadParentModel()
    {
        $environment = $this->getEnvironment();

        if (!($parentId = $environment->getInputProvider()->getParameter('pid'))) {
            throw new DcGeneralRuntimeException(
                'TreeView needs a proper parent id defined, somehow none is defined?',
                1
            );
        }

        $pid = ModelId::fromSerialized($parentId);

        if (!($parentProvider = $environment->getDataProvider($pid->getDataProviderName()))
        ) {
            throw new DcGeneralRuntimeException(
                'TreeView needs a proper parent data provider defined, somehow none is defined?',
                1
            );
        }

        $collector = new ModelCollector($environment);
        if (!($parentItem = $collector->getModel($pid))) {
            // No parent item found, might have been deleted.
            // We transparently create it for our filter to be able to filter to nothing.
            $parentItem = $parentProvider->getEmptyModel();
            $parentItem->setId($parentId);
        }

        return $parentItem;
    }
746307
public static CollectionFactoryManager getInstance() {

    if (instance == null) {
      synchronized (CollectionFactoryManagerImpl.class) {
        if (instance == null) {
          CollectionFactoryManagerImpl manager = new CollectionFactoryManagerImpl();
          manager.initialize();
          instance = manager;
        }
      }
    }
    return instance;
  }
1160139
public function load()
    {
        $raw = parent::load();

        try {
            return $raw !== false ? $this->formatter->decode($raw) : false;
        } catch (RuntimeException $e) {
            throw new RuntimeException(sprintf("Failed to load file '%s': %s", $this->getFilePath(), $e->getMessage()), $e->getCode(), $e);
        }
    }
1335911
protected function getCollectionManager()
    {
        return $this->getPrototype(
            $this->collectionManagerClass,
            ['umi\orm\collection\ICollectionManager']
        )
            ->createSingleInstance(
                [
                    $this->getObjectCollectionFactory(),
                    $this->collections
                ]
            );
    }
320644
public function getCollection(string $resourceClass, string $operationName = null, array $context = [])
    {
        /** @var ObjectManager $manager */
        $manager = $this->managerRegistry->getManagerForClass($resourceClass);

        $repository = $manager->getRepository($resourceClass);
        if (!method_exists($repository, 'createQueryBuilder')) {
            throw new RuntimeException('The repository class must have a "createQueryBuilder" method.');
        }

        $queryBuilder = $repository->createQueryBuilder('o');
        $queryNameGenerator = new QueryNameGenerator();
        foreach ($this->collectionExtensions as $extension) {
            $extension->applyToCollection($queryBuilder, $queryNameGenerator, $resourceClass, $operationName, $context);

            if ($extension instanceof QueryResultCollectionExtensionInterface && $extension->supportsResult($resourceClass, $operationName, $context)) {
                return $extension->getResult($queryBuilder, $resourceClass, $operationName, $context);
            }
        }

        return $queryBuilder->getQuery()->getResult();
    }
1225940
public function createCollection()
    {
        $collectClass = $this->collectionClass();
        if ($collectClass === 'array') {
            return [];
        }

        if (!class_exists($collectClass)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] does not exist.',
                $collectClass
            ));
        }

        if (!is_subclass_of($collectClass, ArrayAccess::class)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] must implement ArrayAccess.',
                $collectClass
            ));
        }

        $collection = new $collectClass;

        return $collection;
    }
1240172
public function get()
    {
        if (! $this->singleton) {
            return call_user_func($this->loader);
        }
        if ($this->object === null) {
            $this->object = call_user_func($this->loader);
        }

        return $this->object;
    }
450625
public function proto()
    {
        $objType = $this->objType();
        if (!$objType) {
            throw new RuntimeException('Can not create prototype, object type is undefined');
        }

        return $this->modelFactory()->get($objType);
    }
511509
private function getLoader()
    {
        if (null == $this->loader) {
            $this->loader = new Twig_Loader_Filesystem(
                $this->locations
            );
        }
        return $this->loader;
    }
1171947
public function getCollection() {
		$collectionName = $this->collectionName;
		if(empty($collectionName)){
			return NULL;
			}
		$collection = $collectionName::getInstance();
		return $collection;
	}
743281
public function getModel()
    {
        $collection = $this->getCollection();

        /** @var EntityDataModel $model */
        $model = $collection->getModel();
        $model->setEntityManager($this);

        return $model;
    }
860664
public function getApp(): App
    {
        if (!is_null($this->getTemplateEngine()->getApp())) {
            return $this->getTemplateEngine()->getApp();
        } else {
            throw new RuntimeException('Template engine is not initialized with application');
        }
    }
1234949
protected function metadataLoader()
    {
        if ($this->metadataLoader === null) {
            throw new RuntimeException(sprintf(
                'Metadata Loader is not defined for "%s"',
                get_class($this)
            ));
        }

        return $this->metadataLoader;
    }
1234023
public AbstractCollection getCollection()
        throws CacheReloadException
    {
        AbstractCollection ret = Form.get(this.collectionUUID);
        if (ret == null) {
            ret = Table.get(this.collectionUUID);
        }
        return ret;
    }
356092
public function getModel()
    {
        $namePath = $this->getModelClass();
        $model = new $namePath();

        if (!($model instanceof EntityDataModel)) {
            throw new \Exception($this->valueClass.' is not an instance of EntityModel.');
        }

        return $model;
    }