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

Service definition changes for EntityValueResolver #1812

Closed
wants to merge 2 commits into from

Conversation

eltharin
Copy link

@eltharin eltharin commented Jul 8, 2024

This PR is related symfony/symfony#57676 for add a variableLoader service to inject in EntityValueResolver to allow user to have it's own variables (eg: user) in mapEntity

Service Definition change for allow user inject its own variables in EntityValueResolver

Symfony review change : EntityValueResolverVariableInjector to UserInjector
@eltharin eltharin force-pushed the addTokenInEntityResolver branch from b3b0dd3 to 0a71f6e Compare July 12, 2024 11:18
@@ -533,6 +534,12 @@ protected function ormLoad(array $config, ContainerBuilder $container)
$controllerResolverDefaults['evict_cache'] ?? null,
$controllerResolverDefaults['disabled'] ?? false,
]));
} else {
$container->getDefinition('doctrine.orm.entity_value_resolver')->setArgument(2, (new Definition(MapEntity::class)));
Copy link
Member

Choose a reason for hiding this comment

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

why this change ?

Copy link
Author

@eltharin eltharin Jul 12, 2024

Choose a reason for hiding this comment

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

If not I can't set my new argument, I have this error :

``
In DefinitionErrorExceptionPass.php line 48:

Invalid constructor argument 4 for service "doctrine.orm.entity_value_resolver": argument 3 must be defined before. Check your service definition.
``

Copy link
Author

Choose a reason for hiding this comment

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

I can just remove the if to have only one initialisation.

@eltharin eltharin force-pushed the addTokenInEntityResolver branch 3 times, most recently from 789183f to 96e5b2d Compare July 13, 2024 14:09
@eltharin eltharin force-pushed the addTokenInEntityResolver branch from 96e5b2d to b856ad0 Compare July 13, 2024 14:35
@dmaicher
Copy link
Contributor

Closing as the PR on Symfony side was also closed. See symfony/symfony#57676 (comment)

@dmaicher dmaicher closed this Jul 22, 2024
@seb-jean
Copy link

seb-jean commented Oct 9, 2024

Hello, what would be the solution to solve this problem?

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

Successfully merging this pull request may close these issues.

4 participants