mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
add docgen:normalization for relation
This commit is contained in:
@@ -26,6 +26,8 @@ class RelationshipRepository implements ObjectRepository
|
||||
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
private EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
{
|
||||
$this->repository = $em->getRepository(Relationship::class);
|
||||
@@ -66,12 +68,14 @@ class RelationshipRepository implements ObjectRepository
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function countByPerson(Person $person): int
|
||||
public function findOneBy(array $criteria): ?Relationship
|
||||
{
|
||||
return $this->buildQueryByPerson($person)
|
||||
->select('COUNT(p)')
|
||||
->getQuery()
|
||||
->getSingleScalarResult();
|
||||
return $this->findOneBy($criteria);
|
||||
}
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return Relationship::class;
|
||||
}
|
||||
|
||||
private function buildQueryByPerson(Person $person): QueryBuilder
|
||||
|
Reference in New Issue
Block a user