Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity hydration fails with QuoteStrategy enabled #5654

Closed
basz opened this issue Feb 6, 2016 · 1 comment
Closed

Entity hydration fails with QuoteStrategy enabled #5654

basz opened this issue Feb 6, 2016 · 1 comment
Assignees

Comments

@basz
Copy link

basz commented Feb 6, 2016

I've create a backtick quoting strategy.

Entity hydration seems to fail when I enable the strategy.

$user = $this->getRepository(User::class)->findOneBy(['email' => 'me@example.com']);

Errors with;

Undefined index: id

/Volumes/hf-model-development@s01.localhost/vendor/doctrine/orm/lib/Doctrine/ORM/Utility/IdentifierFlattener.php:97
/Volumes/hf-model-development@s01.localhost/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2513
/Volumes/hf-model-development@s01.localhost/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php:144
/Volumes/hf-model-development@s01.localhost/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php:69
/Volumes/hf-model-development@s01.localhost/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:147
/Volumes/hf-model-development@s01.localhost/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:720
/Volumes/hf-model-development@s01.localhost/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php:196
/Volumes/hf-model-development@s01.localhost/test/src/Entity/Authentication/UserDBTest.php:31

Seems to be the hydrateColumnInfo method in the sqlResult loop of SimpleObjectHydrator::hydrateRowData

When I replace

$this->hydrateColumnInfo($column);

for

$this->hydrateColumnInfo('`'.$column.'`');

Things work as expected.

@basz basz changed the title QuoteStrategy Entity hydration fails with QuoteStrategy enabled Feb 6, 2016
@ostrolucky ostrolucky added this to the 3.0 milestone Aug 7, 2018
@ostrolucky
Copy link
Member

Quoting strategy has been removed in Doctrine 3.x, now everything is quoted

@ostrolucky ostrolucky self-assigned this Aug 10, 2018
@greg0ire greg0ire removed this from the 3.0.0 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants