Adds a loader to handle the given filter.

@param string          $filter
@param LoaderInterface $loader
342729
public function addLoader(string $filter, LoaderInterface $loader): void
    {
        $this->loaders[$filter] = $loader;
    }
1290045
protected function getLoader(string $path): LoaderInterface
    {
        if (null === $this->loaderClass) {
            throw new RuntimeException('You must implement '.__METHOD__.' or pass the loader class to the constructor');
        }

        return new $this->loaderClass($path);
    }
486051
public static function addAdapter(AnLoaderAdapterInterface $adapter)
    {
        self::$_adapters[$adapter->getType()] = $adapter;
        self::$_prefix_map[$adapter->getPrefix()] = $adapter->getType();
    }
987186
public function load(LoaderInterface $loader, $merge = true)
    {
        $this->internalLoad($loader->load(), $merge);
    }
1126737
public function addLoader(Loader $loader)
    {
        $loader->setLocator($this->locator);

        $this->resolver->addLoader($loader);
    }
999910
public function removeListenerLoader($loader)
	{
		if ($loader instanceof LoaderInterface)
		{
			$loader = $loader->getName();
		}

		if (isset($this->loaders[$loader]))
		{
			unset($this->loaders[$loader]);
		}

		return $this;
	}
1247313
protected function configureLoader(LoaderInterface $loader)
    {
        if ($loader instanceof Base) {
            $loader->setORM($this->getORM());
            if ($this->logger) {
                $loader->setLogger($this->logger);
            }
        }
        if (is_callable(array($loader, 'addProvider'))) { // new in Alice 1.7.2
            $loader->addProvider($this->providers);
        } else { // BC path
            $loader->setProviders($this->providers);
        }
    }
64026
protected function executeLoader(LoaderInterface $loader)
    {
        $offset = 0;

        try {

            while ($result = $loader->load($this->limit, $offset)) {

                $this->persist($result);
                $offset += $this->limit;
            }

        } catch (LoaderException $e) {
            $this->getLogger()->error($e->getMessage());
        }
    }
821867
public function removeLoaderByFile($file)
    {
        foreach ($this->loaders as $i => $loader) {
            /** @var LoaderInterface $loader */
            if ($loader->supports($file)) {
                unset($this->loaders[$i]);
            }
        }
    }
512800
public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $classInfo = new \ReflectionClass($this);
        $dir =  dirname($classInfo->getFileName());
        $loader->load($dir . '/config.yml');
    }
483791
public function load(RouteLoaderInterface $loader, $forceValidate = false)
    {
        if (!$this->isValid($forceValidate)) {
            $loader->addListener($this);
            $this->doLoadResources($loader, $forceValidate);
            $loader->removeListener($this);
        }

        return $this->storage->read();
    }
1363626
protected function ensureByFilter(AssetInterface $asset, $filter)
    {
        if ($filter instanceof FilterInterface) {
            $filterInstance = $filter;
            $asset->ensureFilter($filterInstance);

            return;
        }

        $filterClass = $filter;

        if (!is_subclass_of($filterClass, 'Assetic\Filter\FilterInterface', true)) {
            $filterClass .= (substr($filterClass, -6) === 'Filter') ? '' : 'Filter';
            $filterClass  = 'Assetic\Filter\\' . $filterClass;
        }

        if (!class_exists($filterClass)) {
            throw new Exception\RuntimeException(
                'No filter found for ' . $filter
            );
        }

        if (!isset($this->filterInstances[$filterClass])) {
            $this->filterInstances[$filterClass] = new $filterClass();
        }

        $filterInstance = $this->filterInstances[$filterClass];

        $asset->ensureFilter($filterInstance);
    }
586236
public function addFilter(FilterInterface $filter, $placement = self::CHAIN_APPEND)
    {
        if ($placement == self::CHAIN_PREPEND) {
            array_unshift($this->filters, $filter);
        } else {
            $this->filters[] = $filter;
        }

        return $this;
    }
1361702
public function setLoader(Loader $loader)
    {
        $this->loader = $loader;
        $this->loader->setNamespace($this->getNamespace());
    }
1367595
private function buildLoader($loader)
    {
        if ($loader instanceof TemplateLoaderInterface || is_callable($loader)) {
            return $loader;
        }

        if (is_string($loader) && is_subclass_of($loader, TemplateLoaderInterface::class, true)) {
            return function () use ($loader) {
                return new $loader();
            };
        }
    }
313132
public function add($loader, $name = null)
    {
        if (empty($name)) {
            $name = 'loader.' . count($this->loaders);
        }

        $this->loaders[$name] = $loader;
    }
1184107
public function visitFilter(FilterInterface $filter)
    {
        if ($filter instanceof DummyFilter) {
            $type = 'dummy';
        } elseif ($filter instanceof SelectFilter) {
            $type = 'select';
        } elseif ($filter instanceof SearchFilter) {
            $type = 'search';
        } elseif ($filter instanceof SortFilter) {
            $type = 'sort';
        } elseif ($filter instanceof PaginationFilter) {
            $type = "{$filter->getType()}-pagination";
        } elseif (method_exists($filter, 'getType') === true) {
            $type = $filter->getType();
        } else {
            $type = 'dummy';
        }
        $template = "filter/$type.twig";

        return $this
            ->loadTemplate($template)
            ->render(
                [
                    "id" => $filter->getId(),
                    "options" => $filter->getOptions(),
                ]
            );
    }