*/ class BookType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder ->add('id', IntegerType::class, ['label' => 'book_id_header', 'disabled' => $options['lock_id']]) ->add('title', TextType::class, ['label' => 'book_title_header']) ->add('author', TextType::class, ['label' => 'book_author_header']) ->add('language', TextType::class, ['label' => 'book_language_header', 'required' => false]) ->add('edition', TextType::class, ['label' => 'book_edition_header', 'required' => false]) ->add('publisher', TextType::class, ['label' => 'book_publisher_header', 'required' => false]) ->add('publicationLoc', TextType::class, ['label' => 'book_publication_loc_header', 'required' => false]) ->add('publicationYear', IntegerType::class, ['label' => 'book_publication_year_header', 'required' => false]) ->add('isbn', TextType::class, ['label' => 'book_isbn_header', 'required' => false]) ->add('issn', TextType::class, ['label' => 'book_issn_header', 'required' => false]) ->add('placement', TextType::class, ['label' => 'book_placement_header', 'required' => false]) ->add('save', SubmitType::class, ['label' => 'book_action_save']); } public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'data_class' => Book::class, 'lock_id' => false, ]); $resolver->setAllowedTypes('lock_id', 'bool'); } }