--
You received this message because you are subscribed to the Google Groups "Symfony Brasil" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony-pt+unsubscribe@googlegroups.com.
To post to this group, send email to symfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/symfony-pt.
For more options, visit https://groups.google.com/d/optout.
Olá André,Utilizando o `CollectionType` do Form do Symfony (https://symfony.com/doc/current/reference/forms/types/collection.html) você não precisa se preocupar muito com esses relações.Veja como utilizar https://symfony.com/doc/current/form/form_collections.html.E se tiver alguma dúvida como salvar o objeto dá uma olhada aqui https://symfony.com/doc/current/forms.html#handling-form-submissionsAtt.
2018-04-17 11:46 GMT-03:00 André Luiz Vargas Goulart <alv...@gmail.com>:
OláFaz alguns anos que não programava e decidi ver se ainda lembrava.É a primeira vez que estou usando o Symfony e estou achando bem divertido.Surgiu-me uma dúvida sobre o relacionamentoUm cliente tem muitos telefonesmapeei no yml, pois na engenharia reversa o doctrine não fez.quando incluo um cliente novo, logo os telefones também são novos.Então deu um erro no objeto telefone dizendo que o cliente não pode ser nulo.Resolvi o problema assim:$objCliente->getTelefone()->first();while ($objTelefone = $objCliente->getTelefone()->current()){$objTelefone->setCliCodigoid($objCliente);$objCliente->getTelefone()->next();}A minha dúvida é se esse código é realmente necessário ou eu fiz algo errado?Obrigado
--
You received this message because you are subscribed to the Google Groups "Symfony Brasil" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony-pt+...@googlegroups.com.
To post to this group, send email to symfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/symfony-pt.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony-pt+unsubscribe@googlegroups.com.
To post to this group, send email to symfo...@googlegroups.com.
Visit this group at https://groups.google.com/group/symfony-pt.
For more options, visit https://groups.google.com/d/optout.