UOW computeChangesets and uninitialized entities #10275
-
Hello, I am currently working on performance issues on our Symfony4 / Doctrine 2.7.5 project. I decided to search what happened in the UnitOfWork and came into these lines // private function computeSingleEntityChangeSet($entity): void
// ...
// Ignore uninitialized proxy objects
if ($entity instanceof Proxy && ! $entity->__isInitialized()) {
return;
} My (probably a little bit naive) question is : why should we handle uninitialized entities that are not Proxy instances here? Changing this code into // Ignore uninitialized entities
if (! $entity->__isInitialized()) {
return;
} avoid the useless hydrations in my case. Can somebody explain me what I am probably missing? Thank you in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Because if the entity is not a Proxy instance, __isInitialized() cannot be called!! Sorry for the dummy question, I cannot delete the discussion myself😢. |
Beta Was this translation helpful? Give feedback.
Because if the entity is not a Proxy instance, __isInitialized() cannot be called!! Sorry for the dummy question, I cannot delete the discussion myself😢.