-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Bug Report
| Q | A |
|---|---|
| Version | 3.3.3 |
| Previous Version if the bug is a regression | 3.3.2 |
Summary
I have entities with magic methods. When converting from ORM 2 -> ORM 3, we previously had problems (see here).
We made the corrections noted and this worked until this change in ORM 3.3.3. Specifically this line in UnitOfWork
Hydrator::hydrate($entity, (array) $class->reflClass->newInstanceWithoutConstructor());✅ if I remove this line, it works properly for me.
Current behavior
ORM 3.3.3 is apparently attempting to hydrate disallowed values (null) into the Ghost. Additionally, ORM is attempting to read uninitialized values.
App\Entity\Application::setStatus(): Argument #1 ($status) must be of type App\Enum\ApplicationStatus, null given, called in /app/src/Entity/CustomCheckboxEntryTrait.php on line 75
// CustomCheckboxEntryTrait
$method = 'set'.ucfirst($arg);
if (method_exists($this, $method)) {
$this->$method($value); // <-- line 75
return;
}We also see errors like this
Typed property App\Entity\Application::$genderEntry must not be accessed before initialization
📝 note
I fully expect that the problem is with our implementation of the magic methods (which we require). So, I am willing to correct our code if that is what is required. But this still is a regression from 3.3.2 -> 3.3.3 for us.
This is all quite challenging for me and I am trying to understand but having great difficulty. your patience is appreciated.