Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot normalize attribute "timezone" because injected serializer is not a normalizer

Can't normalize DateTime onject in php (Symfony)... Why it doesn't work? DateTime is the object, isn't it?
$normalizers->normalize($patient->getDateAdded())
Error: Cannot normalize attribute "timezone" because injected serializer is not a normalizer

like image 262
John Doe Avatar asked Oct 29 '22 17:10

John Doe


1 Answers

You must inject serializer into normalizer. Use $normalizer->setSerializer($this->get('))

like image 102
EvgenySalnikov Avatar answered Nov 09 '22 05:11

EvgenySalnikov