mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-24 07:35:03 +00:00
fix: Fix FamilyMemberController and Repository.
This commit is contained in:
@@ -1,17 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\AMLI\FamilyMembersBundle\Repository;
|
||||
|
||||
use Chill\AMLI\FamilyMembersBundle\Entity\FamilyMember;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* FamilyMemberRepository
|
||||
*
|
||||
* @method FamilyMember|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method FamilyMember|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method FamilyMember[] findAll()
|
||||
* @method FamilyMember[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class FamilyMemberRepository extends \Doctrine\ORM\EntityRepository
|
||||
class FamilyMemberRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function findActiveByPerson(Person $person)
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
return $this->findBy([ 'person' => $person ]);
|
||||
parent::__construct($registry, FamilyMember::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return FamilyMember[]
|
||||
*/
|
||||
public function findByPerson(Person $person): array
|
||||
{
|
||||
return $this->findBy(['person' => $person]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user