Answer the question
In order to leave comments, you need to log in
Why are values not written to the intermediate table, although all links are registered?
Tell me why the values are not written to the intermediate table, although all the links are registered, and also from the view, if you dump it, do all the fields come?
There is a Many-to-Many relationship between Chat & Group entities.
There is a ChatType.php form
->add('groups', EntityType::class, array(
'class' => Group::class,
'expanded' => true,
'multiple' => true,
'choice_label' => 'getTitle',
))
$chat = $em->getRepository(Chat::class)->findOneBy(['id' => $id]);
$form = $this->createForm(ChatType::class, $chat);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em->persist($chat);
$em->flush();
return $this->redirectToRoute('chats');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question