-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Hello friends.
I have two entities Order and Product (One-to-Many relation).
How should I adjust Field for this relation so I can add new Products while creating Order
Something like this
I managed to create this form using CollectionField
CollectionField::new('products')->setEntryType(ProductsEntryType::class);
with CrudFormType
// ProductsEntryType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$entity = $this->entityFactory->create(ProductCrudController::getEntityFqcn());
$this->entityFactory->processFields($entity, FieldCollection::new([TextField::new('description'), TextField::new('price')]));
$builder->add(
'products',
CrudFormType::class,
[
'entityDto' => $entity,
]
);
}
But I need to pass fields from ProductCrudController with permissions.
Can someone please help me to render product(s) form(s) inside order form with storing all data?
Thanks.
Metadata
Metadata
Assignees
Labels
No labels