collection-crud/src/Form/FilmType.php

75 lines
2.1 KiB
PHP

<?php declare(strict_types=1);
namespace App\Form;
use App\Entity\Film;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\{AbstractType, FormBuilderInterface};
use Symfony\Component\OptionsResolver\OptionsResolver;
class FilmType extends AbstractType
{
/**
* {@inheritDoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->add('brand')
->add('productLine')
->add('filmName')
->add('filmAlias')
->add('filmSpeedAsa')
->add('filmSpeedDin')
->add('filmFormat', ChoiceType::class, [
'choices' => [
'Small Format' => [
'35mm' => '135',
'110' => '110',
],
'Medium Format' => [
'120' => '120',
'127' => '127',
'620' => '620',
],
],
])
->add('filmBase', ChoiceType::class, [
'choices' => [
'Cellulose Triacetate' => 'Cellulose Triacetate',
'Polyester' => 'Polyester',
'Polyethylene Naphtalate' => 'Polyethylene Naphtalate',
],
])
->add('unusedRolls')
->add('rollsInCamera')
->add('developedRolls')
->add('chemistry', ChoiceType::class, [
'choices' => [
'B & W' => 'B & W',
'C-41' => 'C-41',
'E-6' => 'E-6',
'Other' => 'Other',
],
])
->add('notes');
}
/**
* {@inheritDoc}
*/
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => Film::class,
]);
}
/**
* {@inheritDoc}
*/
public function getBlockPrefix(): string
{
return 'camerabundle_film';
}
}