public function __construct(ModuleRepositoryInterface $objectRepository) { $this->_class = $objectRepository; $this->_em = $objectRepository->getEntityManager(); $this->parameters = new ArrayCollection(); $tables = new EavTables($this->_em); $this->_tables = $tables->getTables(); if ($objectRepository->getModule() && !$objectRepository->getModule()->isFlattern()) { $this->setParameter(':module_id', $objectRepository->getModule()->getId()); } }
/** * @param Request $request * @param Module $module * * @return \Symfony\Component\HttpFoundation\Response */ public function indexAction(Request $request, Module $module, Context $context, $language) { if (!$module->getCategory() || $module->getCategory()->getId() != EavCategories::EAV_MODULE) { throw $this->createNotFoundException(); } /** @var $moduleRepository EavModuleRepository **/ $moduleRepository = $this->moduleRepository->getRepository($module)->setClass(new EavModuleRepository()); $entities = $moduleRepository->findByModule($context, $module, $language); $flattern = $this->get('bigfish.eav.flattern.table')->generate($module); $grid = $this->container->get('bigfish.grid.factory')->createGrid($this->container->get('bigfish.eav.grid.datalist.type'), $entities, array('module' => $module, 'title' => $module->getName(), 'description' => $module->getDescription())); return $this->render('BigfishEavBundle:Default:index.html.twig', array('grid' => $grid->createView(), 'entities' => $entities)); }