S
S
symnoob2018-12-12 19:19:31
symfony
symnoob, 2018-12-12 19:19:31

Symfony4 Doctrine I'm getting an error when saving to the database, how can I fix (association field)?

good time of the day,
I get an error when saving to the database, how can I fix it?

Expected value of type "MyBundle\HotelBundle\Model\Pic" for association field "MyBundle\HotelBundle\Model\Hotel#$pics", got "NULL" instead.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Decadal, 2018-12-12
@symnoob

you need to make the type for the pics field nullable=true and remove the strict typehint if it exists

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question