EcommerceBundle/Controller/FeatureValueController.php
public function newAction($featureId)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Feature $feature */
        $feature = $em->getRepository('EcommerceBundle:Feature')->find($featureId);

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

        $entity = new FeatureValue();
        $form   = $this->createForm(new FeatureValueType(), $entity);

        return array(
            'entity'      => $entity,
            'feature'   => $feature,
            'form'        => $form->createView(),
        );
    }
public function newAction($featureId)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Feature $feature */
        $feature = $em->getRepository('EcommerceBundle:Feature')->find($featureId);

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

        $entity = new FeatureValue();
        $form   = $this->createForm(new FeatureValueType(), $entity);

        return array(
            'entity'      => $entity,
            'feature'   => $feature,
            'form'        => $form->createView(),
        );
    }
public function newAction ( $ featureId ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; /** @var Feature $feature */ $ feature = $ em -> getRepository ( 'EcommerceBundle:Feature' ) -> find ( $ featureId ) ; if ( ! $ feature ) { throw $ this -> createNotFoundException ( 'Unable to find Feature entity.' ) ; } $ entity = new FeatureValue ( ) ; $ form = $ this -> createForm ( new FeatureValueType ( ) , $ entity ) ; return array ( 'entity' => $ entity , 'feature' => $ feature , 'form' => $ form -> createView ( ) , ) ; }
Displays a form to create a new FeatureValue entity.

@param int $featureId The feature id

@throws NotFoundHttpException
@return array

@Route("/new")
@Method("GET")
@Template()
Displays a form to create a new FeatureValue entity .