aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-04-27 19:17:19 +0200
committerThomas Citharel <tcit@tcit.fr>2017-06-23 09:27:23 +0200
commit5847dd3572caf06c0e0d5e307241c3b6bc3f8611 (patch)
tree8905d4de388dd18239ea323f4650ff0070064eab /src/Wallabag/CoreBundle/Form/Type/EditGroupSharesType.php
parent2585953e0dae631b65c59b0e31196d65bdde84df (diff)
downloadwallabag-5847dd3572caf06c0e0d5e307241c3b6bc3f8611.tar.gz
wallabag-5847dd3572caf06c0e0d5e307241c3b6bc3f8611.tar.zst
wallabag-5847dd3572caf06c0e0d5e307241c3b6bc3f8611.zip
MOAR WIP
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
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}