]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Form/Type/EditEntryType.php
Convert array + phpDoc
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / EditEntryType.php
CommitLineData
82d6d9cb
JB
1<?php
2
3namespace Wallabag\CoreBundle\Form\Type;
4
5use Symfony\Component\Form\AbstractType;
619cc453
JB
6use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\Extension\Core\Type\TextType;
82d6d9cb
JB
9use Symfony\Component\Form\FormBuilderInterface;
10use Symfony\Component\OptionsResolver\OptionsResolver;
11
12class EditEntryType extends AbstractType
13{
14 public function buildForm(FormBuilderInterface $builder, array $options)
15 {
16 $builder
4094ea47 17 ->add('title', TextType::class, [
0d42217e
JB
18 'required' => true,
19 'label' => 'entry.edit.title_label',
4094ea47
JB
20 ])
21 ->add('is_public', CheckboxType::class, [
0d42217e
JB
22 'required' => false,
23 'label' => 'entry.edit.is_public_label',
4094ea47
JB
24 ])
25 ->add('url', TextType::class, [
0d42217e
JB
26 'disabled' => true,
27 'required' => false,
28 'label' => 'entry.edit.url_label',
4094ea47
JB
29 ])
30 ->add('save', SubmitType::class, [
0d42217e 31 'label' => 'entry.edit.save_label',
4094ea47 32 ])
82d6d9cb
JB
33 ;
34 }
35
36 public function configureOptions(OptionsResolver $resolver)
37 {
4094ea47 38 $resolver->setDefaults([
82d6d9cb 39 'data_class' => 'Wallabag\CoreBundle\Entity\Entry',
4094ea47 40 ]);
82d6d9cb
JB
41 }
42
619cc453 43 public function getBlockPrefix()
82d6d9cb
JB
44 {
45 return 'entry';
46 }
47}