This commit is contained in:
lubiana 2025-06-08 19:25:02 +02:00
parent b052697417
commit 43ca79f650
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
14 changed files with 292 additions and 57 deletions

View file

@ -0,0 +1,40 @@
<?php
namespace App\Form;
use App\Entity\DrinkType;
use App\Entity\InventoryRecord;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class InventoryRecordForm extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('quantity')
->add('timestamp', null, [
'widget' => 'single_text',
])
->add('createdAt', null, [
'widget' => 'single_text',
])
->add('updatedAt', null, [
'widget' => 'single_text',
])
->add('drinkType', EntityType::class, [
'class' => DrinkType::class,
'choice_label' => 'id',
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => InventoryRecord::class,
]);
}
}