HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/dvpis2026/dvpis.kaunokolegija.lt/src/Form/LecturerAgreementType.php
<?php

namespace App\Form;

use App\Entity\LecturerAgreement;
use App\Entity\LecturerAgreementType as LCT;
use App\Entity\LecturerPosition;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class LecturerAgreementType extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('lecturerPosition', EntityType::class, [
                'class' => LecturerPosition::class,
                'choice_label' => 'name',
                'label' => 'Pareigybė',
            ])
            ->add('contractFrom', null, [
                'label' => 'Sutartis nuo',
                'widget' => 'single_text',
                'html5' => false,
                'attr' => [
                    'class' => 'calendar'
                ],
                'required' => true,
            ])
            ->add('contractTo', null, [
                'label' => 'Sutartis iki',
                'widget' => 'single_text',
                'html5' => false,
                'attr' => [
                    'class' => 'calendar'
                ],
                'required' => false,
            ])
            ->add('postSize', null, ['label' => 'Užimamas etatas'])
            ->add('lecturerAgreementType', EntityType::class, [
                'class' => LCT::class,
                'choice_label' => 'name',
                'label' => 'Sutarties tipas',
                'required' => false,
            ])
            ->add('notes', null, ['label' => 'Pastabos'])
        ;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => LecturerAgreement::class,
        ]);
    }
}