Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles

This commit is contained in:
Julie Lenaerts 2023-03-22 09:06:12 +01:00
commit efa475df0f
2 changed files with 12 additions and 6 deletions

View File

@ -76,8 +76,17 @@ class SimilarPersonMatcher
$qb->select('p')
->from(Person::class, 'p')
->join('p.centerHistory', 'center_history')
->where('SIMILARITY(p.fullnameCanonical, UNACCENT(LOWER(:fullName))) >= :precision')
->andWhere($qb->expr()->in('p.center', ':centers'));
->andWhere($qb->expr()->in('center_history.center', ':centers'))
->andWhere($qb->expr()->andX(
$qb->expr()->lte('center_history.startDate', 'CURRENT_DATE()'),
$qb->expr()->orX(
$qb->expr()->isNull('center_history.endDate'),
$qb->expr()->gt('center_history.endDate', 'CURRENT_DATE()')
)
))
;
$qb
->setParameter('fullName', $this->personRender->renderString($person, []))

View File

@ -805,12 +805,9 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
return $this;
}
/**
* @return $this
*/
public function setProfession(string $profession): self
public function setProfession(?string $profession): self
{
$this->profession = $profession;
$this->profession = (string) $profession;
return $this;
}