diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php index fc8233d23..d9fa5b6e3 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method AccompanyingPeriodWorkGoal|null find($id, $lockMode = null, $lockVersion = null) @@ -12,10 +12,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method AccompanyingPeriodWorkGoal[] findAll() * @method AccompanyingPeriodWorkGoal[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class AccompanyingPeriodWorkGoalRepository extends ServiceEntityRepository +final class AccompanyingPeriodWorkGoalRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, AccompanyingPeriodWorkGoal::class); + $this->repository = $entityManager->getRepository(AccompanyingPeriodWorkGoal::class); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php index f879e97d7..5d455b617 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method AccompanyingPeriodWork|null find($id, $lockMode = null, $lockVersion = null) @@ -12,10 +12,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method AccompanyingPeriodWork[] findAll() * @method AccompanyingPeriodWork[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class AccompanyingPeriodWorkRepository extends ServiceEntityRepository +final class AccompanyingPeriodWorkRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, AccompanyingPeriodWork::class); + $this->repository = $entityManager->getRepository(AccompanyingPeriodWork::class); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php index ef1130b62..c99ca8efc 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php @@ -22,8 +22,9 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod; +use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; -use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\Query\ResultSetMappingBuilder; /** @@ -32,17 +33,24 @@ use Doctrine\ORM\Query\ResultSetMappingBuilder; * * @package Chill\PersonBundle\Repository */ -class ClosingMotiveRepository extends EntityRepository +final class ClosingMotiveRepository { + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) + { + $this->repository = $entityManager->getRepository(ClosingMotive::class); + } + /** * @param bool $onlyLeaf * @return mixed */ public function getActiveClosingMotive(bool $onlyLeaf = true) { - $rsm = new ResultSetMappingBuilder($this->getEntityManager()); - $rsm->addRootEntityFromClassMetadata($this->getClassName(), 'cm'); - + $rsm = new ResultSetMappingBuilder($this->repository->getEntityManager()); + $rsm->addRootEntityFromClassMetadata($this->repository->getClassName(), 'cm'); + $sql = "SELECT ".(string) $rsm." FROM chill_person_accompanying_period_closingmotive AS cm WHERE @@ -55,10 +63,11 @@ class ClosingMotiveRepository extends EntityRepository } $sql .= " ORDER BY cm.ordering ASC"; - - return $this->_em + + return $this + ->repository + ->getEntityManager() ->createNativeQuery($sql, $rsm) - ->getResult() - ; + ->getResult(); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php index b41e77591..aca7a9c68 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php @@ -23,8 +23,8 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method Comment|null find($id, $lockMode = null, $lockVersion = null) @@ -32,11 +32,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method Comment[] findAll() * @method Comment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class CommentRepository extends ServiceEntityRepository +final class CommentRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, Comment::class); + $this->repository = $entityManager->getRepository(Comment::class); } - } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php index 6a5b28901..c2851b851 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php @@ -23,8 +23,8 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method Origin|null find($id, $lockMode = null, $lockVersion = null) @@ -32,11 +32,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method Origin[] findAll() * @method Origin[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class OriginRepository extends ServiceEntityRepository +final class OriginRepository { - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Origin::class); - } + private EntityRepository $repository; + public function __construct(EntityManagerInterface $entityManager) + { + $this->repository = $entityManager->getRepository(Origin::class); + } } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php index 46eaaaaa0..4f625b59c 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php @@ -23,8 +23,8 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method Resource|null find($id, $lockMode = null, $lockVersion = null) @@ -32,11 +32,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method Resource[] findAll() * @method Resource[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class ResourceRepository extends ServiceEntityRepository +final class ResourceRepository { - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, Resource::class); - } + private EntityRepository $repository; + public function __construct(EntityManagerInterface $entityManager) + { + $this->repository = $entityManager->getRepository(Resource::class); + } } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php index fbe957ecf..0f157ed42 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php @@ -23,8 +23,8 @@ namespace Chill\PersonBundle\Repository; use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method AccompanyingPeriodParticipation|null find($id, $lockMode = null, $lockVersion = null) @@ -32,11 +32,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method AccompanyingPeriodParticipation[] findAll() * @method AccompanyingPeriodParticipation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class AccompanyingPeriodParticipationRepository extends ServiceEntityRepository +final class AccompanyingPeriodParticipationRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, AccompanyingPeriodParticipation::class); + $this->repository = $entityManager->getRepository(AccompanyingPeriodParticipation::class); } - } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index fffb55ede..07aa0a55f 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -23,9 +23,8 @@ namespace Chill\PersonBundle\Repository; use Chill\PersonBundle\Entity\AccompanyingPeriod; -use Chill\PersonBundle\Entity\Person; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method AccompanyingPeriod|null find($id, $lockMode = null, $lockVersion = null) @@ -33,10 +32,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method AccompanyingPeriod[] findAll() * @method AccompanyingPeriod[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class AccompanyingPeriodRepository extends ServiceEntityRepository +final class AccompanyingPeriodRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, AccompanyingPeriod::class); + $this->repository = $entityManager->getRepository(AccompanyingPeriod::class); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php index feea6d44d..b11d3d93a 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\Household; use Chill\PersonBundle\Entity\Household\HouseholdMembers; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method HouseholdMembers|null find($id, $lockMode = null, $lockVersion = null) @@ -12,11 +12,13 @@ use Doctrine\Persistence\ManagerRegistry; * @method HouseholdMembers[] findAll() * @method HouseholdMembers[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class HouseholdMembersRepository extends ServiceEntityRepository +final class HouseholdMembersRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, HouseholdMembers::class); + $this->repository = $entityManager->getRepository(HouseholdMembers::class); } // /** diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php index 38522806c..78a68f56d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\Household; use Chill\PersonBundle\Entity\Household\Household; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method Household|null find($id, $lockMode = null, $lockVersion = null) @@ -12,11 +12,13 @@ use Doctrine\Persistence\ManagerRegistry; * @method Household[] findAll() * @method Household[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class HouseholdRepository extends ServiceEntityRepository +final class HouseholdRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, Household::class); + $this->repository = $entityManager->getRepository(Household::class); } // /** diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php index 315cee94f..c5dea689a 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php @@ -2,12 +2,22 @@ namespace Chill\PersonBundle\Repository; +use Chill\PersonBundle\Entity\PersonAltName; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; + /** * PersonAltNameRepository * * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ -class PersonAltNameRepository extends \Doctrine\ORM\EntityRepository +final class PersonAltNameRepository { + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) + { + $this->repository = $entityManager->getRepository(PersonAltName::class); + } } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php index 8ab711b15..989baaeec 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php @@ -4,6 +4,7 @@ namespace Chill\PersonBundle\Repository; use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\PersonNotDuplicate; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; /** @@ -11,8 +12,15 @@ use Doctrine\ORM\EntityRepository; * * @package Chill\PersonBundle\Repository */ -class PersonNotDuplicateRepository extends EntityRepository +final class PersonNotDuplicateRepository { + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) + { + $this->repository = $entityManager->getRepository(PersonNotDuplicate::class); + } + /** * @param \Chill\PersonBundle\Entity\Person $person * @@ -20,7 +28,7 @@ class PersonNotDuplicateRepository extends EntityRepository */ public function findNotDuplicatePerson(Person $person) { - $qb = $this->createQueryBuilder('pnd'); + $qb = $this->repository->createQueryBuilder('pnd'); $qb->select('pnd') ->where('pnd.person1 = :person OR pnd.person2 = :person') ; diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index ccc56b639..12733a668 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -18,16 +18,25 @@ namespace Chill\PersonBundle\Repository; +use Chill\PersonBundle\Entity\Person; +use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\QueryBuilder; -/** - * Class PersonRepository - * - * @package Chill\PersonBundle\Repository - */ -class PersonRepository extends EntityRepository +final class PersonRepository { + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) + { + $this->repository = $entityManager->getRepository(Person::class); + } + + public function find($id, $lockMode = null, $lockVersion = null) + { + return $this->repository->find($id, $lockMode, $lockVersion); + } + /** * @param string $phonenumber * @param $centers @@ -44,7 +53,7 @@ class PersonRepository extends EntityRepository $maxResults, array $only = ['mobile', 'phone'] ) { - $qb = $this->createQueryBuilder('p'); + $qb = $this->repository->createQueryBuilder('p'); $qb->select('p'); $this->addByCenters($qb, $centers); @@ -71,7 +80,7 @@ class PersonRepository extends EntityRepository array $only = ['mobile', 'phone'] ): int { - $qb = $this->createQueryBuilder('p'); + $qb = $this->repository->createQueryBuilder('p'); $qb->select('COUNT(p)'); $this->addByCenters($qb, $centers); diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php index b030e1617..c9ab3c931 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\SocialWork; use Chill\PersonBundle\Entity\SocialWork\Evaluation; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method Evaluation|null find($id, $lockMode = null, $lockVersion = null) @@ -12,10 +12,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method Evaluation[] findAll() * @method Evaluation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class EvaluationRepository extends ServiceEntityRepository +final class EvaluationRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, Evaluation::class); + $this->repository = $entityManager->getRepository(Evaluation::class); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php index 031c31764..30576b4ed 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\SocialWork; use Chill\PersonBundle\Entity\SocialWork\Goal; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method Goal|null find($id, $lockMode = null, $lockVersion = null) @@ -12,10 +12,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method Goal[] findAll() * @method Goal[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class GoalRepository extends ServiceEntityRepository +final class GoalRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, Goal::class); + $this->repository = $entityManager->getRepository(Goal::class); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php index 511823d61..004a2f82c 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\SocialWork; use Chill\PersonBundle\Entity\SocialWork\Result; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method Result|null find($id, $lockMode = null, $lockVersion = null) @@ -12,10 +12,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method Result[] findAll() * @method Result[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class ResultRepository extends ServiceEntityRepository +final class ResultRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, Result::class); + $this->repository = $entityManager->getRepository(Result::class); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php index f0f2e81b4..cfa9adbd7 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php @@ -3,8 +3,8 @@ namespace Chill\PersonBundle\Repository\SocialWork; use Chill\PersonBundle\Entity\SocialWork\SocialAction; -use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method SocialAction|null find($id, $lockMode = null, $lockVersion = null) @@ -12,10 +12,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method SocialAction[] findAll() * @method SocialAction[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class SocialActionRepository extends ServiceEntityRepository +final class SocialActionRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, SocialAction::class); + $this->repository = $entityManager->getRepository(SocialAction::class); } } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php index e64b057f4..2f6eb3ba1 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php @@ -4,7 +4,8 @@ namespace Chill\PersonBundle\Repository\SocialWork; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; -use Doctrine\Persistence\ManagerRegistry; +use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\EntityRepository; /** * @method SocialIssue|null find($id, $lockMode = null, $lockVersion = null) @@ -12,10 +13,12 @@ use Doctrine\Persistence\ManagerRegistry; * @method SocialIssue[] findAll() * @method SocialIssue[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ -class SocialIssueRepository extends ServiceEntityRepository +final class SocialIssueRepository { - public function __construct(ManagerRegistry $registry) + private EntityRepository $repository; + + public function __construct(EntityManagerInterface $entityManager) { - parent::__construct($registry, SocialIssue::class); + $this->repository = $entityManager->getRepository(SocialIssue::class); } }