mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #11053] Handle ENUM Primary Key in ObjectHydrator.php #12778
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/doctrine/orm/pull/11053
State: closed
Merged: No
Where
App\Core\Nomenclature\Countryis an ENUM used as a Primary Key of a relation, so it tries to cast it to string -- should be simple enough to reproduce, I an not allowed proper time to create a proper PR with tests and allI've fixed it on our end by copying the source file and applying the same patch, I hope this helps
Error:
Object of class App\Core\Nomenclature\Country could not be converted to string
at vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:1903
at Doctrine\ORM\UnitOfWork->tryGetByIdHash(object(Country), 'App\Core\Entity\Location\CountryGroupCountry')
(vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:304)
at Doctrine\ORM\Internal\Hydration\ObjectHydrator->getEntityFromIdentityMap('App\Core\Entity\Location\CountryGroupCountry', array('id' => object(Country)))
(vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:403)