public function homeAction()
 {
     $api = $this->get('dlin.zendesk')->getApi();
     $categoriesClient = new CategoryClient($api);
     $categoriesResult = $categoriesClient->getAll();
     $sectionsClient = new SectionClient($api);
     $sectionsResult = $sectionsClient->getAll();
     $articleClient = new ArticleClient($api);
     $articleResult = $articleClient->getAll();
     return $this->render('DlinZendeskBundle:Home:home.html.twig', array('categories' => $categoriesResult->getItems(), 'sections' => $sectionsResult->getItems(), 'articles' => $articleResult->getItems()));
 }
 public function showAction($idCategorie)
 {
     $api = $this->get('dlin.zendesk')->getApi();
     $categorieClient = new CategoryClient($api);
     $categorieResult = $categorieClient->getOneById($idCategorie);
     $sectionClient = new SectionClient($api);
     $sections = $sectionClient->getSectionsByCategorie($categorieResult->getId())->getItems();
     $articleClient = new ArticleClient($api);
     $articles = [];
     foreach ($sections as $section) {
         $articles = array_merge($articles, $articleClient->getArticlesBySection($section->getId())->getItems());
     }
     return $this->render('DlinZendeskBundle:Categorie:categorie_show.html.twig', array('categorie' => $categorieResult, 'sections' => $sections, 'articles' => $articles));
 }