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

Support user defined repositories #857

Merged
merged 2 commits into from Oct 16, 2018
Merged

Support user defined repositories #857

merged 2 commits into from Oct 16, 2018

Conversation

Nek-
Copy link
Contributor

@Nek- Nek- commented Sep 26, 2018

A verification was done with EntityRepository inheritance. This commit drop it in favor of a check on interface ObjectRepository which allow the user to define its own complete repository.

Closes #856

use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Repository\RepositoryFactory;
use Psr\Container\ContainerInterface;
use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
use Doctrine\Common\Persistence\ObjectRepository;

Choose a reason for hiding this comment

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

duplicate

@Nek- Nek- force-pushed the patch-1 branch 2 times, most recently from f0dd12e to e0649ca Compare October 11, 2018 16:02
@Nek-
Copy link
Contributor Author

Nek- commented Oct 11, 2018

Errors looks not related.

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

An additional test should verify that it is indeed possible to use a repository class that doesn't extend EntityRepository - you can use the other tests in ContainerRepositoryFactory for guidance.

Repository/ContainerRepositoryFactory.php Outdated Show resolved Hide resolved
@Nek-
Copy link
Contributor Author

Nek- commented Oct 12, 2018

@alcaeus feedback done 😃

Copy link
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

Functionality looks good - @kimhemsoe or @Majkl578, could you confirm that checking for ObjectRepository is safe for ORM 2.4?

Repository/ContainerRepositoryFactory.php Outdated Show resolved Hide resolved
A verification was done with EntityRepository inheritance. This commit drop it in
favor of a check on interface ObjectRepository which allow user to define its own
complete repository.
Older versions of PHP does not support the current implementation
so I changed it. Also in order to be able to run the test suite with
old versions of Doctrine, this change was also required (because
the interface differ).
Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

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

👍

@kimhemsoe kimhemsoe merged commit 8f6c3fc into doctrine:master Oct 16, 2018
@kimhemsoe
Copy link
Member

@Nek- Thanks

@Nek- Nek- deleted the patch-1 branch October 16, 2018 09:37
@kimhemsoe kimhemsoe added this to the 1.9.2 milestone Oct 30, 2018
@kimhemsoe kimhemsoe self-assigned this Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants