-
Notifications
You must be signed in to change notification settings - Fork 439
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
Added: ability to choose different entity manager #1042
Conversation
Hey, @Steveb-p, would you mind checking this PR? |
I'll try to look it up more thoroughly in the evening. |
@balabis Have you tested this against your application? I've looked through the extension and enqueue:
default:
# plus basic bundle configuration
job: true
# by default bundle will add a default orm mapping configuration
# if you define custom mappings, you can specify which entity manager to use here
entity_manager_name: ~ This part from the original documentation was responsible for injecting I'm pretty sure tests would fail the moment you'd start using a different doctrine entity manager than default - reason being that To test your branch against your application you can use composer's built-in functionality which allows using one's fork instead of a library. In your case it should look something like this: {
"repositories": [
{
"type": "vcs",
"url": "https://github.com/balabis/enqueue-dev.git"
}
],
"require": {
"enqueue/job-queue": "dev-master"
}
} |
The part I removed from docs suggests the user that he should define the Doctrine mappings manually, but in reality that mapping is injected behind the scenes with the code above. So this default mapping is always there, but the user, if he so choses, can define his own mappings (thats what we did). And now you can define as many mappings as you want, but JobStorage will always use the default one. I have used this code with our application. If I specify |
Well, I'm blind apparently. Thanks for finding it. Goes to show that I'm not really that much more familiar with enqueue-bundle itself than you 😄 However, instead of injecting an entity name into Could you please see if this is possible there? |
Ok, will see what I can do. |
What do you think if instead of having:
We'd have something like this:
The idea here would be to prepend the default mapping only if the user has not defined any mappings. |
I would consider a different approach. Instead of trying to establish if there are any mappings provided by the user, create a configuration setting to explicitly inject - with the default being This is also important due to the fact that you can technically provide your own Job classes as far as I'm aware (might be wrong though - as I said, I'm not familiar with JobQueue component). Code proposed would inject mapping in this case anyway. |
Hey, @Steveb-p, mind checking the PR again? |
Yeah, will do in the evening or tomorrow morning. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey, @Steveb-p , have you checked it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long.
There are two things I'd like you to look at at this point. Otherwise than that it look ok to me - I know that code style fixer might be a PITA that causes a lot of changes here (which can probably be avoided by squashing commits and amending/removing those changes) but I think personally it's ok to fix them right away.
Here the discussion: #961 (comment)