Bundle/CoreBundle/Command/WidgetCssGenerateCommand.php
private function getViewsToTreat()
    {
        $templateRepo = $this->entityManager->getRepository('VictoireTemplateBundle:Template');
        $rootTemplates = $templateRepo->getInstance()
            ->where('template.template IS NULL')
            ->getQuery()
            ->getResult();
        $templates = [];
        $recursiveGetTemplates = function ($template) use (&$recursiveGetTemplates, &$templates) {
            array_push($templates, $template);
            foreach ($template->getInheritors() as $_template) {
                if ($_template instanceof Template) {
                    $recursiveGetTemplates($_template);
                }
            }
        };

        foreach ($rootTemplates as $rootTemplate) {
            $recursiveGetTemplates($rootTemplate);
        }

        $pageRepo = $this->entityManager->getRepository('VictoirePageBundle:BasePage');
        $pages = $pageRepo->findAll();
        $errorRepo = $this->entityManager->getRepository('VictoireTwigBundle:ErrorPage');
        $errorPages = $errorRepo->findAll();

        return array_merge($templates, array_merge($pages, $errorPages));
    }
private function getViewsToTreat()
    {
        $templateRepo = $this->entityManager->getRepository('VictoireTemplateBundle:Template');
        $rootTemplates = $templateRepo->getInstance()
            ->where('template.template IS NULL')
            ->getQuery()
            ->getResult();
        $templates = [];
        $recursiveGetTemplates = function ($template) use (&$recursiveGetTemplates, &$templates) {
            array_push($templates, $template);
            foreach ($template->getInheritors() as $_template) {
                if ($_template instanceof Template) {
                    $recursiveGetTemplates($_template);
                }
            }
        };

        foreach ($rootTemplates as $rootTemplate) {
            $recursiveGetTemplates($rootTemplate);
        }

        $pageRepo = $this->entityManager->getRepository('VictoirePageBundle:BasePage');
        $pages = $pageRepo->findAll();
        $errorRepo = $this->entityManager->getRepository('VictoireTwigBundle:ErrorPage');
        $errorPages = $errorRepo->findAll();

        return array_merge($templates, array_merge($pages, $errorPages));
    }
private function getViewsToTreat ( ) { $ templateRepo = $ this -> entityManager -> getRepository ( 'VictoireTemplateBundle:Template' ) ; $ rootTemplates = $ templateRepo -> getInstance ( ) -> where ( 'template.template IS NULL' ) -> getQuery ( ) -> getResult ( ) ; $ templates = [ ] ; $ recursiveGetTemplates = function ( $ template ) use ( & $ recursiveGetTemplates , & $ templates ) { array_push ( $ templates , $ template ) ; foreach ( $ template -> getInheritors ( ) as $ _template ) { if ( $ _template instanceof Template ) { $ recursiveGetTemplates ( $ _template ) ; } } } ; foreach ( $ rootTemplates as $ rootTemplate ) { $ recursiveGetTemplates ( $ rootTemplate ) ; } $ pageRepo = $ this -> entityManager -> getRepository ( 'VictoirePageBundle:BasePage' ) ; $ pages = $ pageRepo -> findAll ( ) ; $ errorRepo = $ this -> entityManager -> getRepository ( 'VictoireTwigBundle:ErrorPage' ) ; $ errorPages = $ errorRepo -> findAll ( ) ; return array_merge ( $ templates , array_merge ( $ pages , $ errorPages ) ) ; }
Get Templates, BasePages and ErrorPages.

@return View[]
Get Templates BasePages and ErrorPages .