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

[Fixtures] Brand new fixtures bundle #5219

Merged
merged 13 commits into from
Jun 17, 2016
Merged

Conversation

pamil
Copy link
Contributor

@pamil pamil commented Jun 9, 2016

Q A
Bug fix? yes
New feature? yes
BC breaks? yes
Related tickets documentation in #5286, fixtures implementation in #5285
License MIT

It's really a work in progress, but feel free to review 🎉 It will be a standalone bundle, not depending on any of Sylius components or bundles.

@pamil pamil force-pushed the fixtures-bundle branch 2 times, most recently from 85318c7 to fa7f116 Compare June 10, 2016 11:09
$locale = $this->localeFactory->createNew();

$locale->setCode($localeCode);
$locale->setEnabled(true);
Copy link
Member

Choose a reason for hiding this comment

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

If it's hardcoded, maybe use $locale->enable()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It won't in the near future

@okwinza
Copy link
Contributor

okwinza commented Jun 13, 2016

This seems very lovely but please don't forget to show some love to docs and write a decent cookbook before replacing simple and straightforward code with something more complex.
(See #5208 and related)

In the meantime i'll try to do something about the docs myself :)

* @param ObjectManager $currencyManager
* @param string $baseCurrencyCode
*/
public function __construct(FactoryInterface $currencyFactory, ObjectManager $currencyManager, $baseCurrencyCode)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the ObjectManager really a currency manager? would call it simply $objectManager

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ObjectManager is so broad that it actually covers nothing. ObjectManager is just a common interface for all persistence layers in Sylius.

Copy link
Contributor

@dantleech dantleech Jun 14, 2016

Choose a reason for hiding this comment

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

well, currency manager implies that it manages currency. what it acutally is is an entity/document manager abstracted as ObjectManager, which can manage any entity/document.

Copy link
Contributor Author

@pamil pamil Jun 14, 2016

Choose a reason for hiding this comment

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

Nevertheless we shouldn't use it (sylius.manager.currency) to manage something else than currency.

@pamil pamil force-pushed the fixtures-bundle branch 2 times, most recently from ed270f1 to c099a47 Compare June 14, 2016 13:07
*/
protected function configureOptionsNode(ArrayNodeDefinition $optionsNode)
{
// no options
Copy link
Member

Choose a reason for hiding this comment

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

We could allow configuring some specific country codes and load all if none provided. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's still an issue if some country codes would be used by Province / Zone fixtures while these countries wouldn't exist in the database.

Copy link
Member

Choose a reason for hiding this comment

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

That's why I think we could really have this geographical_fixture, which defines zones like this:

zones:
    USA:
        countries: US
    EU: 
        countries: PL, DE, FR

And drop the country fixture entirely or keep it.

@pamil pamil force-pushed the fixtures-bundle branch 2 times, most recently from 634cd97 to ef67e28 Compare June 15, 2016 10:52
@pamil pamil mentioned this pull request Jun 15, 2016
@pamil pamil force-pushed the fixtures-bundle branch 5 times, most recently from 0499f8e to 277bb42 Compare June 17, 2016 08:59
/**
* @var FixtureLoaderInterface
*/
private $baseFixtureLoader;
Copy link
Member

Choose a reason for hiding this comment

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

decorated?

@pamil pamil changed the title [WIP] Brand new fixtures bundle [Fixtures] Brand new fixtures bundle Jun 17, 2016
@pamil
Copy link
Contributor Author

pamil commented Jun 17, 2016

Ready to go, documentation & fixtures rewriting outsourced to #5285 & #5286.

@pjedrzejewski pjedrzejewski merged commit d697833 into Sylius:master Jun 17, 2016
@pjedrzejewski
Copy link
Member

Boom! 💥 Nice work Kamil! Thanks!

@okwinza
Copy link
Contributor

okwinza commented Jun 17, 2016

My god, such blazing speed. Great work!

@pamil pamil deleted the fixtures-bundle branch June 17, 2016 20:30
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.

None yet

5 participants