[Question] Serialize Field not managed by Doctrine
See original GitHub issueI have
/**
* @var int
*
* @ORM\Column(type="integer")
*
* @Groups({"read"})
*/
private $productId;
/**
* @var string
*
* @ORM\Column(type="string")
*
* @Groups({"read"})
*/
private $productSource;
And then in below
/**
* @var ProductInterface
*/
private $product;
The $product
is dynamically depending on the object that stored by $productId
and $productSource
(currently i use doctrine subscriber to set it and not use doctrine inheritance mapping for many reason).
The $product
is set and the object is already there. But i have an error like
"No resource found for object of type ..."
How to solve it or do you have a clue to solve it?
Thanks before
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
How to manage deserialized entities with entity manager?
So the solution is to loop the Order::$items array and merge each item individually. Then a new order will be created and connected...
Read more >The Problem with JsonSerializable and Doctrine when ...
Making your classes JsonSerializable is a wonderful way of serializing your object using nothing but PHP internals. This is really useful for classes...
Read more >Working with Objects
When EntityManager#clear() is invoked, all entities that are currently managed by the EntityManager instance become detached. When serializing an entity.
Read more >Databases and the Doctrine ORM
Run php bin/console list doctrine to see a full list. ... This is usually done with attributes: the #[ORM\Column(...)] comments that you see...
Read more >Working with Entity Manager | MikroORM
To understand flush , lets first define what managed entity is: An entity ... Another use case is serialization, we can use the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@teohhanhui : hi, you can try
https://github.com/ad3n/ApiPlatformTest
to check
I use
to ignore that error but it is not solution that i want, because the object is already mapped by api platform.
You can check entity
ShoppingCart
,ShoppingCartItem
andTransaction
@Simperfit : The problem is coming from my connection pool… I use multiple connection through Api Platform and that is problem when use different entity manager to manage entity between read and write…