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

[RFC] Domain managers #1764

Closed
wants to merge 5 commits into from
Closed

Conversation

stloyd
Copy link
Contributor

@stloyd stloyd commented Aug 6, 2014

As many time mentioned (not only me) principale of creating things is not job for repositories, theirs job is finding. So I finally find some time to introduce "proper" managers to do the job right.

@pjedrzejewski
Copy link
Member

Nice, moving the events and persisting to manager sounds good. What do you think about moving the creation logic to another type of service "factory"? That would keep everything even more separated and allow easy overriding/adding new kinds of createNew methods.

@arnolanglade
Copy link
Contributor

👍

@stloyd
Copy link
Contributor Author

stloyd commented Aug 6, 2014

@pjedrzejewski I think that could be next step on the route to separate all the thing(tm) =) This PR IMO should be not doing that much, as it would be kinda painful to migrate after merge. So I guess that "factory" is quite interesting idea, but for further improvements =)

@arnolanglade
Copy link
Contributor

What is the status of this ?

@stloyd stloyd force-pushed the feature/domain_managers branch 3 times, most recently from fae588b to fe93b00 Compare August 20, 2014 09:57
@stloyd stloyd changed the title [RFC][PoC] Domain managers [RFC] Domain managers Aug 20, 2014
@stloyd stloyd force-pushed the feature/domain_managers branch 6 times, most recently from b17ba29 to 2783521 Compare August 22, 2014 07:33
@stloyd
Copy link
Contributor Author

stloyd commented Aug 22, 2014

@Arn0d I guess it's RFR now ;)

@stloyd stloyd force-pushed the feature/domain_managers branch 4 times, most recently from 6a6381d to 0f116d2 Compare August 22, 2014 09:22
@stloyd stloyd force-pushed the feature/domain_managers branch 3 times, most recently from 0565a2a to f2d3780 Compare September 10, 2014 11:08
@ghost
Copy link

ghost commented Sep 11, 2014

well i'm happy for the feature. I hope something like this gets accepted.

@stloyd
Copy link
Contributor Author

stloyd commented Sep 11, 2014

@pjedrzejewski @Arn0d @umpirsky @kayue I guess this is ready for review...

@mtotheikle
Copy link
Contributor

Looking forward to this!

mtotheikle added a commit to Limelyte/SyliusResourceBundle that referenced this pull request Nov 14, 2014
Adds to Sylius/Sylius#1764 as that is first spot I don't notice need for doctrine bundle. We use custom ORM and therefore don't include doctrine
@stloyd stloyd force-pushed the feature/domain_managers branch 2 times, most recently from 85f40e3 to 788dcfd Compare November 19, 2014 14:42
@ghost
Copy link

ghost commented Nov 23, 2014

so will this get merged as is? i think i'm about ready to use this as a patch to my project.

$manager = $this->manager;
if ($manager instanceof EntityManagerInterface) {
$manager->transactional(function ($manager) use ($resource, $action) {
$manager->{$action}($resource);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to test the $action method exists before, right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Look few lines above...

@stloyd stloyd force-pushed the feature/domain_managers branch 2 times, most recently from c08800b to 3991496 Compare December 1, 2014 12:42
@stloyd
Copy link
Contributor Author

stloyd commented Dec 2, 2014

@pjedrzejewski Feedback?

@stloyd stloyd force-pushed the feature/domain_managers branch 2 times, most recently from 936d5c6 to 8ec4e37 Compare December 11, 2014 08:18
@ghost
Copy link

ghost commented Dec 12, 2014

yes. feedback please :)

@amenophis
Copy link
Contributor

@stloyd @pjedrzejewski news about this topic ??

@amenophis
Copy link
Contributor

@pjedrzejewski What about this PR ?

@pjedrzejewski
Copy link
Member

Replaced by #2255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC Discussions about potential changes or new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet