Creates a form to create a Episode entity.

@param Episode $entity The entity

@return \Symfony\Component\Form\Form The form
498607
private function createCreateForm(Episode $entity)
    {
        $form = $this->createForm(EpisodeType::class, $entity, array(
            'action' => $this->generateUrl('oktolab_episode_create'),
            'method' => 'POST',
        ));

        $form->add(
            'submit',
            SubmitType::class,
            [
                'label' => 'oktolab_media.new_episode_create_button',
                'attr' => ['class' => 'btn btn-primary']
            ]
        );

        return $form;
    }
352467
private function createEditForm(SurveyCategory $entity)
    {
        $form = $this->createForm(new SurveyCategoryType(), $entity, array(
            'action' => $this->generateUrl('surveycategory_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

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

        return $form;
    }
1163189
private function createCreateForm(Advert $entity)
    {
        $formConfig = array();
        $user = $this->container->get('security.token_storage')->getToken()->getUser();  
        if ($user->isGranted('ROLE_USER')) {
            $formConfig['actor'] = $user;
        }
        $form = $this->createForm('EcommerceBundle\Form\AdvertType', $entity, array_merge($formConfig, array(
            'action' => $this->generateUrl('ecommerce_advert_new'),
            'method' => 'POST',
        )));

        return $form;
    }
451967
public function createForm($entity, $options = [])
    {
        $options = array_merge($this->type()['formFields']['_create'], $options);

        return $this->Form->create($entity, $options);
    }
205737
private function createCreateForm(MessageType $entity)
    {
        $form = $this->createForm(MessageTypeType::class, $entity, array(
            'action' => $this->generateUrl('messagetype_create'),
            'method' => 'POST',
        ));
        $this->_addFunctionsToForm($form);

        $form->add('create_group', CheckboxType::class, array('label' => "This is a new group.", 'mapped' => false, 'required' => false));
        $form->add('submit', SubmitType::class, array('label' => 'Create'));

        return $form;
    }
1362001
private function createMenuItemCreateForm(MenuItem $entity)
    {
        $form = $this->createForm(new MenuItemType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_item_create', array('id' => $entity->getMenu()->getId())),
            'method' => 'POST',
        ));

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

        return $form;
    }
1211765
protected function createCreateForm($entity)
    {
        $form = $this->createForm(
            $this->getAddFormType(), $entity, [
                'action' => $this->generateUrl($this->getRouteName() . "Add", $this->getRouteParams()),
                'method' => 'POST',
            ]
        );

        return $form;
    }
846372
private function createCreateForm(Collection $entity)
    {
        $form = $this->createForm($this->get('amulen.classification.form.collection'), $entity, array(
            'action' => $this->generateUrl('admin_collection_create'),
            'method' => 'POST',
        ));

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

        return $form;
    }
1126717
public function createByTypeAction($id, Request $request)
    {
        $contentType = $this->contentTypeManager->getContentTypeById($id);

        if ($contentType === null) {
            throw EntityNotFoundException::fromClassNameAndIdentifier(
                $this->configurationManager->getEntityClass('content_type'),
                [$id]
            );
        }

        $contentEntityClass = $this->configurationManager->getEntityClass('content');
        $content = new $contentEntityClass;
        $content->setContentType($contentType);

        $form = $this->createForm(ContentType::class, $content, [
            'action' => $this->generateUrl('sherlockode_acb_content_create_by_type', ['id' => $contentType->getId()]),
            'contentType' => $content->getContentType(),
        ]);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $this->om->persist($content);
            $this->om->flush();

            return $this->redirectToRoute('sherlockode_acb_content_edit', ['id' => $content->getId()]);
        }

        return $this->render('@SherlockodeAdvancedContent/Content/edit_content.html.twig', [
            'form' => $form->createView(),
            'is_ajax' => $request->isXmlHttpRequest(),
        ]);
    }
1131599
private function createCreateForm(Agreement $entity)
    {
        $form = $this->createForm(new AgreementType(), $entity, array(
            'action' => $this->generateUrl('agreement_create'),
            'method' => 'POST',
        ));

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

        return $form;
    }
490332
private function createNewCacheAssetForResolution($episode, $resolution) {
        $asset = $this->getContainer()->get('bprs.asset')->createAsset();
        $asset->setFilekey(
            sprintf('%s.%s',$asset->getFilekey(), $resolution['container'])
        );
        $asset->setAdapter(
            $this->getContainer()->getParameter(
                'oktolab_media.encoding_filesystem'
            )
        );
        $asset->setName($episode->getVideo()->getName());
        $asset->setMimetype($resolution['mimetype']);

        return $asset;
    }
920854
public function createAction(Request $request)
    {
        $entity = new Tag();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();

            $nextAction = $form->get('saveAndAdd')->isClicked()
                ? 'admin_tag_new'
                : 'admin_tag';

            return $this->redirectToRoute($nextAction);
        }

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }
1131260
private function createEditForm(Block $entity) {
        $form = $this->createForm(new BlockType(), $entity, array(
            'action' => $this->generateUrl('block_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

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

        return $form;
    }
170104
private function createMenuItemEditForm(MenuItem $entity)
    {
        $form = $this->createForm(new MenuItemType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_item_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

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

        return $form;
    }
156066
protected function createAbility($ability, $entity, $attributes)
    {
        return Models::ability()->createForModel($entity, $attributes + [
            'name' => $ability,
        ]);
    }
71887
public function createAction(Request $request) {
        $entity = new Post();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $this->processVideo($entity);
            $em->persist($entity);
            $em->flush();

            return $this->redirect($this->generateUrl('admin_post_show', array('id' => $entity->getId())));
        } else {
            $this->get('session')->getFlashBag()->add(
                    'warning', $this->get('translator')->trans('save_fail')
            );
        }

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
697106
private function createEditForm(Menu $entity)
    {
        $form = $this->createForm(new MenuType(), $entity, array(
            'action' => $this->generateUrl('admin_menu_update', array('id' => $entity->getId())),
            'method' => 'PUT',
        ));

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

        return $form;
    }