@param Context $context
@param string $className

@return Filter
@throws RenderingException
@throws \ReflectionException
17305
private function instantiateFilter(Context $context, $className) {
		if($context->view->getFilterFactory()) {
					return $context->view->getFilterFactory()->create($className);
		}

		$reflection = new \ReflectionClass($className);
		$instance = $reflection->newInstance();
		if (! $instance instanceof Filter) {
		    throw new RenderingException($this->getTagName(),
                $context->getFilename(),
                $this->getLineNumber(),
                'Class ' . get_class($instance) . ' is not a Filter.');
        }
        return $instance;
	}
1042983
public function getContext(ModelContextInterface $context = null)
    {
        $context = new ModelContextDatabase(parent::getContext());
        $context->setQuery($this->getObject('lib:database.query.select'));
        return $context;
    }
371286
public function apply( $context ) {
		if ( ! $context instanceof RContext ) {
			$context = new Context( $context );
		}

		return $this->evaluate( $context );
	}
493079
protected function get_text_filters($context) {
        if (!isset($this->textfilters[$context->id])) {
            $this->load_filters($context);
        }
        return $this->textfilters[$context->id];
    }
1288498
protected function applyFilters(EventContext $context)
    {
        foreach($this->filters as $filter)
        {
            $e = $context->getEvent();
            if ($filter->match($e)){
                $filter->processEvent($context);
                $e->consume();
            }
        }
    }
603684
protected final function getReflection(string $className): ReflectionClass
   {
       try {
           $reflexion = new ReflectionClass($className);
       } catch (ReflectionException $e) {
           throw new NotFoundException(
               "Can't get reflection for " . $className . ": not found");
       }
       if (!$reflexion->isInstantiable()) {
           throw new ContainerException(
               "Can't get reflection for " . $className . ": not instanciable");
       }
       return $reflexion;
   }
438076
public function filterSubtables($className, $parameters = array())
    {
        foreach ($this->getDataTables() as $table) {
            $table->filterSubtables($className, $parameters);
        }
    }
548155
public function queueFilterSubtables($className, $parameters = array())
    {
        foreach ($this->getDataTables() as $table) {
            $table->queueFilterSubtables($className, $parameters);
        }
    }
968797
public function setClassName(string $className): ClassPaser
    {
        $this->className = $className;
        $this->reflect_object = (new \ReflectionClass($this->className));

        return $this;
    }
1002336
public function render($context = null)
    {
        try {
            return $this->_render($context);
        } catch (InvalidArgumentException $e) {
            throw $e;
        } catch (RootException $e) {
            throw $this->_createTemplateRenderException($this->__('Could not render placeholder template'), null, $e, $this, $context);
        }
    }
1042560
public function render($context = [])
    {
        parent::render($context);
        $this->getEngine()->parse($this->template);
        $data = [
            'element' => $this->getElement(),
            'context' => $context,
            'renderer' => $this
        ];
        return $this->getEngine()->process($data);
    }
473921
private function fillCache(string $className): void
    {
        if (array_key_exists($className, $this->customSortings)) {
            return;
        }

        $class = new ReflectionClass($className);
        $this->customSortings[$className] = $this->getFromAnnotation($class);
    }
902304
public static function fromClass(string $className) : Mapping
    {
        /* @var ApiMapping $instance */
        $className = '\\'.ltrim($className, '\\');
        if (!class_exists($className, true)) {
            throw new MappingException(
                \sprintf('Provided class %s could not be loaded.', $className)
            );
        }
        $instance = new $className();

        if (!in_array(ApiMapping::class, \class_implements($instance, true))) {
            throw new MappingException(
                \sprintf('Class %s must implement %s.', \ltrim($className, '\\'), ApiMapping::class)
            );
        }

        $mappedClass = [
            static::CLASS_KEY => $instance->getClass(),
            static::ALIAS_KEY => $instance->getAlias(),
            static::ALIASED_PROPERTIES_KEY => $instance->getAliasedProperties(),
            static::HIDE_PROPERTIES_KEY => $instance->getHideProperties(),
            static::ID_PROPERTIES_KEY => $instance->getIdProperties(),
            static::URLS_KEY => $instance->getUrls(),
        ];

        if (\in_array(HalMapping::class, \class_implements($instance, true))) {
            $mappedClass[static::CURIES_KEY] = $instance->getCuries();
        }

        if (\in_array(JsonApiMapping::class, \class_implements($instance, true))) {
            $mappedClass[static::RELATIONSHIPS_KEY] = $instance->getRelationships();
        }

        return static::fromArray($mappedClass);
    }
811148
public function render($template, array $context = array())
    {
        $template = $this->twig->createTemplate($template);

        return $template->render($context);
    }
237104
public final function resolve(string $className, CacheInterface $cache = null)
   {
       try {
           return $this->resolver->resolve($className, $cache);
       } catch (NotFoundException $e) {
           throw $e;
       } catch (ContainerException $e) {
           throw $e;
       }
   }
655931
public final function get($className)
   {
       try {
           return $this->cache->get(... func_get_args());
       } catch (NotFoundException $e) {
           try {
               $service = $this->resolver->resolve($className, $this->cache);
           } catch (NotFoundException $e) {
               throw $e;
           } catch (ContainerException $e) {
               throw $e;
           }
       }
       $this->cache->set($className, $service);
       return $this->cache->get($className);
   }
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;
    }