src/Flowcode/ShopBundle/Controller/AdminProductController.php
private function mediaCreateEditForm(Media $entity, $product, $type)
    {
        $types = $this->container->getParameter('flowcode_media.media_types');
        $class = $types[$entity->getMediaType()]["class_type"];

        $form = $this->createForm(new $class(), $entity, array(
            'action' => $this->generateUrl('admin_product_media_update', array("product" => $product->getId(), 'entity' => $entity->getId(), "type" => $entity->getMediaType())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
private function mediaCreateEditForm(Media $entity, $product, $type)
    {
        $types = $this->container->getParameter('flowcode_media.media_types');
        $class = $types[$entity->getMediaType()]["class_type"];

        $form = $this->createForm(new $class(), $entity, array(
            'action' => $this->generateUrl('admin_product_media_update', array("product" => $product->getId(), 'entity' => $entity->getId(), "type" => $entity->getMediaType())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
private function mediaCreateEditForm ( Media $ entity , $ product , $ type ) { $ types = $ this -> container -> getParameter ( 'flowcode_media.media_types' ) ; $ class = $ types [ $ entity -> getMediaType ( ) ] [ "class_type" ] ; $ form = $ this -> createForm ( new $ class ( ) , $ entity , array ( 'action' => $ this -> generateUrl ( 'admin_product_media_update' , array ( "product" => $ product -> getId ( ) , 'entity' => $ entity -> getId ( ) , "type" => $ entity -> getMediaType ( ) ) ) , 'method' => 'PUT' , ) ) ; $ form -> add ( 'submit' , 'submit' , array ( 'label' => 'Update' ) ) ; return $ form ; }
Creates a form to edit a Media entity.

@param Media $entity The entity

@return \Symfony\Component\Form\Form The form
Creates a form to edit a Media entity .