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

Repository clean up and TranslatableResourceRepository deletion #3854

Merged
merged 9 commits into from
Mar 7, 2016

Conversation

lchrusciel
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? yes
Deprecations? no
Fixed tickets #2614
License MIT
Doc PR

I've made some clean ups in repositories and introduced some new repository interfaces. Moreover, I have also removed TranslatableResourceRepository and translation fields from configuration. It will reduce amount of magic in our repositories and will result in explicit calls to them. I am aware that this is a huge BC break, but it is better to do such changes earlier than later ;)

Update
NOTE: In order to be as explicit as it is possible, I removed all magic methods and functions like getQueryBuilder. Repositories will be much more readable if we will call methods directly, where one has to declare every used join. Previous implementation was hard to maintain as some times we used some objects joined in a parent class of parent class of parent class of the class we used. This was misleading and generated enormous amount of bugs. I removed some spec also, cuz implementation of repository has been changed and it's logic is tested anyway in a behat scenarios.

Uodate2
NOTE: Contains changes from #4271

@lchrusciel lchrusciel changed the title Repository clean up and TranslatableResourceRepository deletetion Repository clean up and TranslatableResourceRepository deletion Jan 12, 2016
@lchrusciel lchrusciel changed the title Repository clean up and TranslatableResourceRepository deletion [WIP ]Repository clean up and TranslatableResourceRepository deletion Jan 12, 2016
@lchrusciel lchrusciel changed the title [WIP ]Repository clean up and TranslatableResourceRepository deletion [WIP] Repository clean up and TranslatableResourceRepository deletion Jan 12, 2016
@michalmarcinkowski michalmarcinkowski added Bug Fix BC Break PRs introducing BC breaks (do not even try to merge). labels Jan 12, 2016

namespace Sylius\Component\Addressing\Repository;

use Doctrine\ORM\NonUniqueResultException;
Copy link
Member

Choose a reason for hiding this comment

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

This definitely cannot be in component.

@lchrusciel lchrusciel force-pushed the repository-xmass-cleaning branch 7 times, most recently from 8c16ae0 to b10a0df Compare January 13, 2016 14:15
@lchrusciel lchrusciel changed the title [WIP] Repository clean up and TranslatableResourceRepository deletion Repository clean up and TranslatableResourceRepository deletion Jan 13, 2016
{
return $this->createQueryBuilder('o')
->where('o.name = :name')
->setParameter('name', $name)
Copy link
Contributor

Choose a reason for hiding this comment

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

The name is not translatable and we don't need to join anything, so I think this method is redundant and we should use simply findOneBy(array('name' => $name)).

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

We should join zone members here.

@lchrusciel lchrusciel force-pushed the repository-xmass-cleaning branch 4 times, most recently from 48a5df5 to 25c7d1b Compare January 14, 2016 13:09
@@ -32,8 +39,13 @@ public function findRootNodes();
* @param string $permalink
*
* @return TaxonInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

|null

@lchrusciel
Copy link
Member Author

@pjedrzejewski Build should be green, so it is good to merge. But we have to resolve #4410 as soon as possible.

pjedrzejewski pushed a commit that referenced this pull request Mar 7, 2016
Repository clean up and TranslatableResourceRepository deletion
@pjedrzejewski pjedrzejewski merged commit 6747781 into Sylius:master Mar 7, 2016
@pjedrzejewski
Copy link
Member

Good work Łukasz! I am glad we have this cleaned up finally...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC Break PRs introducing BC breaks (do not even try to merge).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants