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

[Core] Implement simple ShopperContext #5196

Merged

Conversation

pjedrzejewski
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Related tickets -
License MIT

All services, form types, etc. should be stateless, but sometimes we need to have access (in routing, or other contexts) to currently active channel, currency, locale and customer. This service simplifies this and I have also added this info to the web debug toolbar. So as a developer, you can always check the currently selected context.

This is the first step to clean up all the contexts together and unify their behavior and usage.

zrzut ekranu 2016-06-07 o 23 20 22

@pjedrzejewski pjedrzejewski added New Feature DX Issues and PRs aimed at improving Developer eXperience. labels Jun 7, 2016
@pjedrzejewski pjedrzejewski force-pushed the experimental/shopper-context branch from 802d152 to ca7005c Compare June 7, 2016 21:24
public function getLocaleCode();

/**
* @return CustomerInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

CustomerInterface|null

@pjedrzejewski pjedrzejewski force-pushed the experimental/shopper-context branch from ca7005c to a931d54 Compare June 8, 2016 08:09
/**
* @author Paweł Jędrzejewski <[email protected]>
*/
interface ShopperContextInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about normalizing methods in current interfaces (one has getCurrentX(), the other one - getX()) and then just extending them here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@pamil I think it could be good, but let's leave that for a separate PR, we definitely need to normalize methods on all these contexts.

@michalmarcinkowski michalmarcinkowski merged commit d98db0e into Sylius:master Jun 8, 2016
@michalmarcinkowski
Copy link
Contributor

Nice! 👍

pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
…r-context

[Core] Implement simple ShopperContext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Issues and PRs aimed at improving Developer eXperience.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants