<commit_before><?php
namespace Damedia\SpecialProjectBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class RenderController extends Controller {
	public function footerMenuElementsAction() {
		$pageRepository = $this->getDoctrine()->getRepository('DamediaSpecialProjectBundle:Page');
    	$pages = $pageRepository->findBy(array('parent' => null, 'isPublished' => true), array('id' => 'ASC'));
    	
    	$menuElements = array();
    	foreach ($pages as $page) {
    		$menuElements[] = array('href' => $this->generateUrl('damedia_special_project_view', array('slug' => $page->getSlug())), 'caption' => $page->getTitle());
    	}
		
		return $this->render('DamediaSpecialProjectBundle:Default:footerMenu.html.twig', array('ProjectsFooterMenu' => $menuElements));
	}
	
	public function indexAction() {
        $helper = $this->get('special_project_helper');
        $breadcrumbs = $helper->createInitialBreadcrumbsArray($this);

        $pageRepository = $this->getDoctrine()->getRepository('DamediaSpecialProjectBundle:Page');
        $pages = $pageRepository->findBy(array('isPublished' => true), array('id' => 'DESC'));

        $projects = array();
        foreach ($pages as $page) {
            $padding = ($page->getParent()) ? 1 : 0;

            $projects[] = array('href' => $this->generateUrl('damedia_special_project_view', array('slug' => $page->getSlug())),
                                'caption' => $page->getTitle(),
                                'padding' => $padding);
        }
<commit_msg>- Fixed Pages order in projects list view<commit_after><?php
namespace Damedia\SpecialProjectBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class RenderController extends Controller {
	public function footerMenuElementsAction() {
		$pageRepository = $this->getDoctrine()->getRepository('DamediaSpecialProjectBundle:Page');
    	$pages = $pageRepository->findBy(array('parent' => null, 'isPublished' => true), array('id' => 'ASC'));
    	
    	$menuElements = array();
    	foreach ($pages as $page) {
    		$menuElements[] = array('href' => $this->generateUrl('damedia_special_project_view', array('slug' => $page->getSlug())), 'caption' => $page->getTitle());
    	}
		
		return $this->render('DamediaSpecialProjectBundle:Default:footerMenu.html.twig', array('ProjectsFooterMenu' => $menuElements));
	}
	
	public function indexAction() {
        $helper = $this->get('special_project_helper');
        $breadcrumbs = $helper->createInitialBreadcrumbsArray($this);

        $pageRepository = $this->getDoctrine()->getRepository('DamediaSpecialProjectBundle:Page');
        $pages = $pageRepository->findBy(array('isPublished' => true, 'parent' => null), array('id' => 'DESC'));

        $projects = array();
        foreach ($pages as $page) {
            $projects[] = array('href' => $this->generateUrl('damedia_special_project_view', array('slug' => $page->getSlug())),
                                'caption' => $page->getTitle(),
                                'padding' => 0);

            $children = $page->getChildren();
            if (count($children) > 0) {
                foreach ($children as $child) {
                    $projects[] = array('href' => $this->generateUrl('damedia_special_project_view', array('slug' => $child->getSlug())),
                        'caption' => $child->getTitle(),
                        'padding' => 1);
                }
            }
        }

{'fraction_non_alphanumeric': 0.16535874439461884, 'fraction_numerical': 0.0014013452914798206, 'mean_word_length': 3.3791411042944786, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 70, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4043888', 'n_tokens_mistral': 1026, 'n_tokens_neox': 995, 'n_words': 169}