aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php')
-rw-r--r--src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php b/src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php
new file mode 100644
index 00000000..2c2e3b36
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php
@@ -0,0 +1,43 @@
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Bridge\Doctrine\Form\Type\EntityType;
6use Symfony\Component\Form\AbstractType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\FormBuilderInterface;
9use Symfony\Component\OptionsResolver\OptionsResolver;
10use Wallabag\CoreBundle\Entity\Entry;
11use Wallabag\GroupBundle\Entity\Group;
12
13class EditGroupSharesType extends AbstractType
14{
15 public function buildForm(FormBuilderInterface $builder, array $options)
16 {
17 $builder
18 ->add('groupshares', EntityType::class, [
19 'required' => true,
20 'class' => Group::class,
21 'choices' => $options['groups'],
22 'multiple' => true,
23 'expanded' => true,
24 ])
25 ->add('save', SubmitType::class, [
26 'label' => 'Share',
27 ])
28 ;
29 }
30
31 public function configureOptions(OptionsResolver $resolver)
32 {
33 $resolver->setDefaults([
34 'data_class' => Entry::class,
35 ]);
36 $resolver->setRequired('groups');
37 }
38
39 public function getBlockPrefix()
40 {
41 return 'group_shares';
42 }
43}