Set the doctrine commons functions to be used by the twig extension.

@param \StingerSoft\DoctrineCommons\Utils\DoctrineFunctionsInterface $doctrineFunctions
503179
public function setDoctrineFunctions(\StingerSoft\DoctrineCommons\Utils\DoctrineFunctionsInterface $doctrineFunctions = null) {
		$this->doctrineFunctions = $doctrineFunctions;
	}
637413
public function setBundle(AbstractBundle $bundle)
    {
        $data = $bundle->getValues();
        foreach ($data as $name => $value) {
            $query = $this->getNewQuery();
            $query = $bundle->makeQueryFiltered($query);
            $setting = $query->firstOrNew(['name' => $name]);
            $setting->value = $value;
            $setting->save();
        }
    }
929690
private function addTemplateFunctions()
    {
        //Asignamos las funciones especiales
        $functions = [
            'asset' => TemplateFunctions::ASSETS_FUNCTION,
            'form' => TemplateFunctions::FORM_FUNCTION,
            'form_widget' => TemplateFunctions::WIDGET_FUNCTION,
            'form_button' => TemplateFunctions::BUTTON_FUNCTION,
            'get_config' => TemplateFunctions::CONFIG_FUNCTION,
            'path' => TemplateFunctions::ROUTE_FUNCTION,
            'resource' => TemplateFunctions::RESOURCE_FUNCTION,
            'session' => TemplateFunctions::SESSION_FUNCTION,
            'existsFlash' => TemplateFunctions::EXISTS_FLASH_FUNCTION,
            'getFlash' => TemplateFunctions::GET_FLASH_FUNCTION,
            'getQuery' => TemplateFunctions::GET_QUERY_FUNCTION,
        ];
        foreach($functions as $name => $function) {
            $this->addTemplateFunction($name, $function);
        }
    }
1192484
public void setSharedFunction(String sharedFunctionFiles) {
		if (StrKit.isBlank(sharedFunctionFiles)) {
			throw new IllegalArgumentException("sharedFunctionFiles can not be blank");
		}
		
		String[] fileArray = sharedFunctionFiles.split(",");
		for (String fileName : fileArray) {
			JFinalViewResolver.sharedFunctionFiles.add(fileName);
		}
	}
1328
private function fillDefault(ParameterDefinitionCollectionInterface $definitionCollection): void
    {
        foreach ($definitionCollection->getParameterDefinitions() as $name => $definition) {
            $this->setParameterValue($name, $definition->getDefaultValue());

            if ($definition instanceof CompoundParameterDefinition) {
                $this->fillDefault($definition);
            }
        }
    }
803559
function addFunc(FunctionEntity $func, $includeSee=false)
    {
        $this->fullClassName = $func->getClass();

        $str = '<strong>';

        if( $this->declareAbstraction && $func->isAbstract() )
            $str .= 'abstract ';

        $str .=  $func->getName().'(';

        if( $func->hasParams() ) {
            $params = [];
            foreach($func->getParams() as $param) {
                $paramStr = '<em>'.$param->getType().'</em> <strong>'.$param->getName();
                if( $param->getDefault() ) {
                    $paramStr .= '='.$param->getDefault();
                }
                $paramStr .= '</strong>';
                $params[] = $paramStr;
            }
            $str .= '</strong>'.implode(', ', $params) .')';
        } else {
            $str .= ')';
        }

        $str .= '</strong> : <em>'.$func->getReturnType().'</em>';

        if( $func->isDeprecated() ) {
            $str = '<strike>'.$str.'</strike>';
            $str .= '<br /><em>DEPRECATED - '.$func->getDeprecationMessage().'</em>';
        } elseif( $func->getDescription() ) {
            $str .= '<br /><em>'.$func->getDescription().'</em>';
        }
        if ($func->getSee() && $includeSee) {
            $str .= '<br /><em>&nbsp;&nbsp;&nbsp;&nbsp;See: ' .
                implode(', ', $func->getSee()) . '</em>';
        }

        $str = str_replace(['</strong><strong>', '</strong></strong> '], ['','</strong>'], trim($str));

        if( $func->getExample() )
            $this->examples[$func->getName()] = $func->getExample();

        $firstCol =  $func->getVisibility() . ($func->isStatic() ? ' static':'');
        $markDown = '| '.$firstCol.' | '.$str.' |';

        $this->add($markDown);
        return $markDown;
    }
738411
protected function parseFunction(FunctionLike $node, FunctionModelInterface $function): void
    {
        foreach ($node->getParams() as $param) {
            $this->parameterNodeParser->invoke($param, $function);
        }

        $return = new ReturnModel();
        $return->setParentNode($function);
        if ($node->getReturnType() !== null) {
            $this->typeNodeParser->invoke($node->getReturnType(), $return);
        }
        $function->setReturn($return);
    }
1163704
public function update(PluginBundleInterface $plugin)
    {
        $this->validate($plugin, true);

        $this->dbWriter->update($plugin, $this->validator->getPluginConfiguration());
    }
107232
protected function setFamily(FamilyInterface $family)
    {
        $this->family = $family;
        $this->container->get('router')->getContext()->setParameter('familyCode', $family->getCode());
    }
196934
public function add_timber_functions( $twig ) {
		/* actions and filters */
		$twig->addFunction(new Twig_Function('action', function( $context ) {
					$args = func_get_args();
					array_shift($args);
					$args[] = $context;
					call_user_func_array('do_action', $args);
				}, array('needs_context' => true)));

		$twig->addFunction(new Twig_Function('function', array(&$this, 'exec_function')));
		$twig->addFunction(new Twig_Function('fn', array(&$this, 'exec_function')));

		$twig->addFunction(new Twig_Function('shortcode', 'do_shortcode'));

		/* TimberObjects */
		$twig->addFunction(new Twig_Function('TimberPost', function( $pid, $PostClass = 'Timber\Post' ) {
					if ( is_array($pid) && !Helper::is_array_assoc($pid) ) {
						foreach ( $pid as &$p ) {
							$p = new $PostClass($p);
						}
						return $pid;
					}
					return new $PostClass($pid);
				} ));
		$twig->addFunction(new Twig_Function('TimberImage', function( $pid = false, $ImageClass = 'Timber\Image' ) {
					if ( is_array($pid) && !Helper::is_array_assoc($pid) ) {
						foreach ( $pid as &$p ) {
							$p = new $ImageClass($p);
						}
						return $pid;
					}
					return new $ImageClass($pid);
				} ));

		$twig->addFunction(new Twig_Function('TimberTerm', array($this, 'handle_term_object')));

		$twig->addFunction(new Twig_Function('TimberUser', function( $pid, $UserClass = 'Timber\User' ) {
					if ( is_array($pid) && !Helper::is_array_assoc($pid) ) {
						foreach ( $pid as &$p ) {
							$p = new $UserClass($p);
						}
						return $pid;
					}
					return new $UserClass($pid);
				} ));

		/* TimberObjects Alias */
		$twig->addFunction(new Twig_Function('Post', function( $pid, $PostClass = 'Timber\Post' ) {
					if ( is_array($pid) && !Helper::is_array_assoc($pid) ) {
						foreach ( $pid as &$p ) {
							$p = new $PostClass($p);
						}
						return $pid;
					}
					return new $PostClass($pid);
				} ));
		$twig->addFunction(new Twig_Function('Image', function( $pid, $ImageClass = 'Timber\Image' ) {
					if ( is_array($pid) && !Helper::is_array_assoc($pid) ) {
						foreach ( $pid as &$p ) {
							$p = new $ImageClass($p);
						}
						return $pid;
					}
					return new $ImageClass($pid);
				} ));
		$twig->addFunction(new Twig_Function('Term', array($this, 'handle_term_object')));
		$twig->addFunction(new Twig_Function('User', function( $pid, $UserClass = 'Timber\User' ) {
					if ( is_array($pid) && !Helper::is_array_assoc($pid) ) {
						foreach ( $pid as &$p ) {
							$p = new $UserClass($p);
						}
						return $pid;
					}
					return new $UserClass($pid);
				} ));

		/* bloginfo and translate */
		$twig->addFunction(new Twig_Function('bloginfo', 'bloginfo'));
		$twig->addFunction(new Twig_Function('__', '__'));
		$twig->addFunction(new Twig_Function('translate', 'translate'));
		$twig->addFunction(new Twig_Function('_e', '_e'));
		$twig->addFunction(new Twig_Function('_n', '_n'));
		$twig->addFunction(new Twig_Function('_x', '_x'));
		$twig->addFunction(new Twig_Function('_ex', '_ex'));
		$twig->addFunction(new Twig_Function('_nx', '_nx'));
		$twig->addFunction(new Twig_Function('_n_noop', '_n_noop'));
		$twig->addFunction(new Twig_Function('_nx_noop', '_nx_noop'));
		$twig->addFunction(new Twig_Function('translate_nooped_plural', 'translate_nooped_plural'));

		return $twig;
	}
1304938
public function apply(ComponentInterface $component)
    {
        /**
         * isRootOfCustomizations property used in TargetSelector
         * @see TargetSelector::checkRootCondition
         */
        $component->isRootOfCustomizations = true;
        parent::apply($component);
        unset($component->isRootOfCustomizations);
    }
1051371
public function addDsmParamsToConfig(Configuration $doctrineConfig, ConfigInterface $config): void
    {
        $paths          = $this->getPathInformation($config);
        $namingStrategy = $config->get(ConfigInterface::PARAM_DOCTRINE_NAMING_STRATEGY);
        $driver         = new StaticPHPDriver($paths);
        $doctrineConfig->setMetadataDriverImpl($driver);
        $doctrineConfig->setNamingStrategy($namingStrategy);
    }
418977
protected function prepareFunctions(array $functions)
    {
        \natcasesort($functions);

        // My kingdom for a generator.
        $ret = [];

        foreach ($functions as $name) {
            if ($this->showItem($name)) {
                $ret[$name] = [
                    'name'  => $name,
                    'style' => self::IS_FUNCTION,
                    'value' => $this->presentSignature($name),
                ];
            }
        }

        return $ret;
    }
855563
public function setForwardFunction($forwardFunction)
    {
        // If it's the same as any thing in the chain, drop it.
        if ($forwardFunction == $this->getForwardFunction()) {
            return $this;
        }
        $this->forwardFunction = $forwardFunction;

        return $this;
    }
1284300
public function validate(\ReflectionFunctionAbstract $reflectionFunction)
    {
        foreach ($reflectionFunction->getParameters() as $parameter) {
            $this->validateParameter($parameter);
        }

        return $this;
    }
103666
protected function addArgumentsToFunctionDescriptor(array $arguments, FunctionDescriptor $functionDescriptor): void
    {
        foreach ($arguments as $argument) {
            $this->addArgumentDescriptorToFunction(
                $functionDescriptor,
                $this->createArgumentDescriptor($functionDescriptor, $argument)
            );
        }
    }
355308
public function addTranslationFunctions($twig)
    {
        $twig->addFunction('_x', new Twig_SimpleFunction('_x',
            function ($text, $context, $domain = 'default') {
                return _x($text, $context, $domain);
            }
        ));

        $twig->addFunction('_n', new Twig_SimpleFunction('_n',
            function ($single, $plural, $number, $domain = 'default') {
                return _n($single, $plural, $number, $domain);
            }
        ));

        $twig->addFunction('_nx', new Twig_SimpleFunction('_nx',
            function ($single, $plural, $number, $context, $domain = 'default') {
                return _nx($single, $plural, $number, $context, $domain);
            }
        ));

        return $twig;
    }