rofl
This commit is contained in:
parent
b052697417
commit
43ca79f650
14 changed files with 292 additions and 57 deletions
40
src/Form/InventoryRecordForm.php
Normal file
40
src/Form/InventoryRecordForm.php
Normal 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,
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue