public function indexAction($categoryId)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Category $entity */
        $entity = $em->getRepository('EcommerceBundle:Category')->find($categoryId);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Category entity.');
        }

        return array(
            'category' => $entity,
        );
    }
public function indexAction($categoryId)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Category $entity */
        $entity = $em->getRepository('EcommerceBundle:Category')->find($categoryId);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Category entity.');
        }

        return array(
            'category' => $entity,
        );
    }
public function indexAction ( $ categoryId ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; /** @var Category $entity */ $ entity = $ em -> getRepository ( 'EcommerceBundle:Category' ) -> find ( $ categoryId ) ; if ( ! $ entity ) { throw $ this -> createNotFoundException ( 'Unable to find Category entity.' ) ; } return array ( 'category' => $ entity , ) ; }
Lists all subcategories from a Category entity.

@param int $categoryId The category id

@throws NotFoundHttpException
@return array

@Route("/")
@Method("GET")
@Template("EcommerceBundle:Subcategory:index.html.twig")
Lists all subcategories from a Category entity .