updateeeeee
This commit is contained in:
parent
0c758749e0
commit
ca9819a436
12 changed files with 214 additions and 156 deletions
|
@ -14,7 +14,11 @@ class DrinkTypeForm extends AbstractType
|
|||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder->add('name')->add('description')->add('desiredStock', NumberType::class);
|
||||
$builder
|
||||
->add('name')
|
||||
->add('description')
|
||||
->add('currentStock', NumberType::class)
|
||||
->add('wantedStock', NumberType::class);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
|
|
|
@ -5,34 +5,23 @@ declare(strict_types=1);
|
|||
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\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class InventoryRecordForm extends AbstractType
|
||||
class DrinkTypeFormCurrentStockForm extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('quantity', NumberType::class)
|
||||
->add('drinkType', EntityType::class, [
|
||||
'class' => DrinkType::class,
|
||||
'choice_label' => 'id',
|
||||
'attr' => [
|
||||
'style' => 'display: none;',
|
||||
],
|
||||
'label' => false,
|
||||
])
|
||||
;
|
||||
->add('currentStock', NumberType::class);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => InventoryRecord::class,
|
||||
'data_class' => DrinkType::class,
|
||||
]);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue