Skip to content

[LiveComponent] Add support for interfaces while (de)hydrating a Doctrine entity #2834

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

Open
wants to merge 9 commits into
base: 2.x
Choose a base branch
from

Conversation

pink6440
Copy link

@pink6440 pink6440 commented Jun 12, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues Fix #2832
License MIT

Doctrine have the feature to use interface aliased to a concrete entity class.
This PR propose a small modification to ensure that is will also supported by the doctrine hydrator

…iased to an entity

Doctrine have the feature to use interface aliased to a concrete entity class.
This PR propose a small modification to ensure that is will also supported by the doctrine hydrator
@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels Jun 12, 2025
@Kocal Kocal changed the title Update DoctrineEntityHydrationExtension.php, support for interface al… [LiveComponent] Add support for interfaces while (de)hydrating a Doctrine entity Jun 12, 2025
Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first contribution :)

Comment on lines 96 to 98
// if ($om = $registry->getManagerForClass($class)) {
// return self::ensureManagedObject($om, $class);
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should either be removed or kept

@carsonbot carsonbot added Status: Needs Work Additional work is needed and removed Status: Needs Review Needs to be reviewed labels Jun 12, 2025
Making tests
@carsonbot carsonbot added Status: Needs Review Needs to be reviewed and removed Status: Needs Work Additional work is needed labels Jun 12, 2025
@pink6440
Copy link
Author

pink6440 commented Jun 12, 2025

The last commit provides some tests.
I put some comments in the code to explain the logic.

@pink6440 pink6440 requested a review from Kocal June 13, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem while hydrating a Doctrine Entity when using an interface as alias.
3 participants