src/PN/Bundle/HomeBundle/Controller/ProjectController.php
/**
     * Lists and show all Projects entities.
     *
     * @Route("/{slug}", name="fe_project_show", methods={"GET", "POST"})
     */
Lists and show all Projects entities.
Lists and show all Projects entities .
public function showAction(Request $request, $slug) {
        $project = $this->get("fe_seo")->getSlug($request, $slug, new Project());
        if ($project instanceof RedirectResponse) {
            return $project;
        }
        if (!$project) {
            throw $this->createNotFoundException();
        }
        $em = $this->getDoctrine()->getManager();
        $productIdsUsingProject = $em->getRepository(ProductSearch::class)->getProductIdsUsingProject($project);
        $productsUsingProject = [];
        if(!empty($productIdsUsingProject)) {
            $productsUsingProject = $this->getProductsUsingProject($productIdsUsingProject);
        }
        return $this->render('home/project/show.html.twig', [
            'project' => $project,
            'productsUsingProject' => $productsUsingProject,
        ]);
    }
public function showAction ( Request $ request , $ slug ) { $ project = $ this -> get ( " fe_seo " ) -> getSlug ( $ request , $ slug , new Project ( ) ) ; if ( $ project instanceof RedirectResponse ) { return $ project ; } if ( ! $ project ) { throw $ this -> createNotFoundException ( ) ; } $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ productIdsUsingProject = $ em -> getRepository ( ProductSearch :: class ) -> getProductIdsUsingProject ( $ project ) ; $ productsUsingProject = [ ] ; if ( ! empty ( $ productIdsUsingProject ) ) { $ productsUsingProject = $ this -> getProductsUsingProject ( $ productIdsUsingProject ) ; } return $ this -> render ( 'home/project/show.html.twig' , [ 'project' => $ project , 'productsUsingProject' => $ productsUsingProject , ] ) ; }
Lists and show all Projects entities.
Lists and show all Projects entities .