public function getTwig(\Twig_Environment $twig)
    {

        $this->functions->rewind();
        while ($this->functions->valid()) {

            $function = $this->functions->current();
            $twig->addFunction(new \Twig_SimpleFunction($function->getFunctionName(), array($function, 'getFunctionBody')));
            $this->functions->next();

        }

        return $twig;

    }