|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace App\Form;
|
|
namespace App\Form;
|
|
|
|
|
|
|
|
+use App\Entity\Film;
|
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
|
@@ -31,31 +32,35 @@ class FilmType extends AbstractType
|
|
->add('lien', TextType::class, array(
|
|
->add('lien', TextType::class, array(
|
|
'required' => false
|
|
'required' => false
|
|
))
|
|
))
|
|
- ->add('mediaVideo', MediaVideoType::class,array(
|
|
|
|
- 'required' => false,
|
|
|
|
- ))
|
|
|
|
|
|
+ ->add('mediaVideos', CollectionType::class, [
|
|
|
|
+ 'entry_type' => MediaVideoType::class,
|
|
|
|
+ 'entry_options' => array('label'=>false),
|
|
|
|
+ 'allow_add' => true,
|
|
|
|
+ 'allow_delete' => true,
|
|
|
|
+ 'by_reference' => false
|
|
|
|
+ ])
|
|
->add('dateSortie', DateType::class, [
|
|
->add('dateSortie', DateType::class, [
|
|
'input' => 'datetime_immutable',
|
|
'input' => 'datetime_immutable',
|
|
'html5' => true,
|
|
'html5' => true,
|
|
'widget' => 'single_text',
|
|
'widget' => 'single_text',
|
|
'required' => false
|
|
'required' => false
|
|
])
|
|
])
|
|
- ->add('information', TextareaType::class, array(
|
|
|
|
|
|
+ ->add('information', TextareaType::class, [
|
|
'required' => false,
|
|
'required' => false,
|
|
- ))
|
|
|
|
- ->add('genres', CollectionType::class, array(
|
|
|
|
|
|
+ ])
|
|
|
|
+ ->add('genres', CollectionType::class, [
|
|
'entry_type' => GenreType::class,
|
|
'entry_type' => GenreType::class,
|
|
'entry_options' => array('label'=>false),
|
|
'entry_options' => array('label'=>false),
|
|
'allow_add' => true,
|
|
'allow_add' => true,
|
|
'allow_delete' => true
|
|
'allow_delete' => true
|
|
- ))
|
|
|
|
- ->add('realisateurs', CollectionType::class, array(
|
|
|
|
|
|
+ ])
|
|
|
|
+ ->add('realisateurs', CollectionType::class, [
|
|
'entry_type' => RealisateurType::class,
|
|
'entry_type' => RealisateurType::class,
|
|
'entry_options' => array('label'=>false),
|
|
'entry_options' => array('label'=>false),
|
|
'allow_add' => true,
|
|
'allow_add' => true,
|
|
'allow_delete' => true,
|
|
'allow_delete' => true,
|
|
'allow_extra_fields' => true
|
|
'allow_extra_fields' => true
|
|
- ))
|
|
|
|
|
|
+ ])
|
|
->add('save', SubmitType::class, array('label' => 'Enregistrer'));
|
|
->add('save', SubmitType::class, array('label' => 'Enregistrer'));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -64,9 +69,9 @@ class FilmType extends AbstractType
|
|
*/
|
|
*/
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
{
|
|
{
|
|
- $resolver->setDefaults(array(
|
|
|
|
- 'data_class' => 'App\Entity\Film'
|
|
|
|
- ));
|
|
|
|
|
|
+ $resolver->setDefaults([
|
|
|
|
+ 'data_class' => Film::class
|
|
|
|
+ ]);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|