1111
1212namespace MauticPlugin \MauticSqlConditionsBundle \Form \Type ;
1313
14+ use Mautic \CategoryBundle \Form \Type \CategoryListType ;
15+ use Mautic \CoreBundle \Form \Type \FormButtonsType ;
16+ use Mautic \CoreBundle \Form \Type \YesNoButtonGroupType ;
1417use MauticPlugin \MauticSqlConditionsBundle \Validator \Constraint \UrlDnsConstraint ;
1518use Symfony \Component \Form \AbstractType ;
19+ use Symfony \Component \Form \Extension \Core \Type \HiddenType ;
1620use Symfony \Component \Form \Extension \Core \Type \TextareaType ;
21+ use Symfony \Component \Form \Extension \Core \Type \TextType ;
1722use Symfony \Component \Form \FormBuilderInterface ;
23+ use Symfony \Component \OptionsResolver \OptionsResolver ;
1824use Symfony \Component \OptionsResolver \OptionsResolverInterface ;
1925use Symfony \Component \Validator \Constraints \NotBlank ;
2026
@@ -29,7 +35,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
2935
3036 $ builder ->add (
3137 'name ' ,
32- ' text ' ,
38+ TextType::class ,
3339 [
3440 'label ' => 'mautic.core.name ' ,
3541 'label_attr ' => ['class ' => 'control-label ' ],
@@ -59,26 +65,26 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5965
6066 $ builder ->add (
6167 'category ' ,
62- ' category ' ,
68+ CategoryListType::class ,
6369 [
6470 'bundle ' => 'plugin:sqlConditions ' ,
6571 ]
6672 );
6773
68- $ builder ->add ('isPublished ' , ' yesno_button_group ' );
74+ $ builder ->add ('isPublished ' , YesNoButtonGroupType::class );
6975
7076
7177 if (!empty ($ options ['update_select ' ])) {
7278 $ builder ->add (
7379 'buttons ' ,
74- ' form_buttons ' ,
80+ FormButtonsType::class ,
7581 [
7682 'apply_text ' => false ,
7783 ]
7884 );
7985 $ builder ->add (
8086 'updateSelect ' ,
81- ' hidden ' ,
87+ HiddenType::class ,
8288 [
8389 'data ' => $ options ['update_select ' ],
8490 'mapped ' => false ,
@@ -87,29 +93,29 @@ public function buildForm(FormBuilderInterface $builder, array $options)
8793 } else {
8894 $ builder ->add (
8995 'buttons ' ,
90- ' form_buttons '
96+ FormButtonsType::class
9197 );
9298 }
9399 }
94100
95- /**
96- * {@inheritdoc}
97- */
98- public function setDefaultOptions (OptionsResolverInterface $ resolver )
101+
102+ public function configureOptions (OptionsResolver $ resolver )
99103 {
100104 $ resolver ->setDefaults (
101105 [
102106 'data_class ' => 'MauticPlugin\MauticSqlConditionsBundle\Entity\SqlConditions ' ,
103107 ]
104108 );
105109 $ resolver ->setDefined (['update_select ' ]);
110+
106111 }
107112
108113
114+
109115 /**
110116 * @return string
111117 */
112- public function getName ()
118+ public function getBlockPrefix ()
113119 {
114120 return 'sqlConditions ' ;
115121 }
0 commit comments