-
persist and flush workI created an entity and the associated repository with After that, I created an object and stored it in the database.
Once I've executed this code, I can indeed see the data in the PostgreSQL database using pg Admin 4. Find methods do not workNow, if I try to retrieve a product using Any idea why this may be happening? I've tried both to use/inject the More detailsSo, I'm doing something like this
The
and
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We can't simply return the entity objects returned by the find methods as JSON content. We need to use a serializer or create an array from the object properties. In my case, I did
Then in the controller
Alternatively, instead of just installing the packages
|
Beta Was this translation helpful? Give feedback.
We can't simply return the entity objects returned by the find methods as JSON content. We need to use a serializer or create an array from the object properties.
In my case, I did
Then in the controller
Alternatively, instead of just installing the packages
symfony/serializer
andsymfony/property-access
, we can install thesymfony/serializer-pack
pack withcomposer install symfony/serial…