Skip to content

Commit

Permalink
feature #13045 Association hydrator private in product repo should be…
Browse files Browse the repository at this point in the history
… protected (Nek-)

This PR was merged into the 1.13 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.13
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no
| License         | MIT

This class is designed to be extended. Therefore having a private field not overridable seems to be a bad idea.

Another idea could be to take it as a constructor parameter but it just makes no sense since it would just suggest to the user add its own private property to make the whole thing work. This commit is to me the best approach to the problem.



Commits
-------

26d6adf fix: association hydrator private in product repo

This class is designed to be extended. Therefore having a private field not overridable seems to be a bad idea.

Another idea could be to take it as a constructor parameter but it just makes no sense since it would just suggest to the user add its own private property to make the whole thing work. This commit is to me the best approach to the problem.
  • Loading branch information
jakubtobiasz committed Feb 7, 2023
2 parents 48b1cdd + 26d6adf commit 0872626
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class ProductRepository extends BaseProductRepository implements ProductRepositoryInterface
{
private AssociationHydrator $associationHydrator;
protected AssociationHydrator $associationHydrator;

public function __construct(EntityManager $entityManager, ClassMetadata $class)
{
Expand Down

0 comments on commit 0872626

Please sign in to comment.