public function indexAction()
 {
     $em = $this->getDoctrine()->getManager();
     $obj = new \AppBundle\Entity\GalleryEntity();
     $imagenesMainAlbum = $em->getRepository('MaithCommonAdminBundle:mAlbum')->findOneBy(array('object_id' => $obj->getId(), 'object_class' => $obj->getFullClassName(), 'name' => 'inicio'));
     $mainFiles = array();
     if ($imagenesMainAlbum) {
         $mainFiles = $imagenesMainAlbum->getFiles();
     }
     $imagenesSecondSliderAlbum = $em->getRepository('MaithCommonAdminBundle:mAlbum')->findOneBy(array('object_id' => $obj->getId(), 'object_class' => $obj->getFullClassName(), 'name' => 'filosofia'));
     $secondSliderfiles = array();
     if ($imagenesSecondSliderAlbum) {
         $secondSliderfiles = $imagenesSecondSliderAlbum->getFiles();
     }
     return $this->render('default/index.html.twig', array('mainSlider' => $mainFiles, 'secondSlider' => $secondSliderfiles, 'activemenu' => 'homepage'));
 }
 public function galleryAction(Request $request)
 {
     //$mediaGallery = $this->get('media_gallery_manager');
     //$files = array_reverse($mediaGallery->getGalleryFiles('galeria'));
     $em = $this->getDoctrine()->getManager();
     $obj = new \AppBundle\Entity\GalleryEntity();
     $imagenesAlbum = $em->getRepository('MaithCommonAdminBundle:mAlbum')->findOneBy(array('object_id' => $obj->getId(), 'object_class' => $obj->getFullClassName(), 'name' => 'galeria'));
     $files = array();
     if ($imagenesAlbum != null) {
         $files = $imagenesAlbum->getFiles();
     }
     return $this->render('AppBundle:default:galeria.html.twig', array('bodycss' => 'blog', 'activemenu' => 'galeria', 'files' => $files));
 }