person: move similar person matcher to PersonACLEwareRepository

This commit is contained in:
nobohan
2022-02-17 11:33:06 +01:00
parent aebb21935b
commit a3ffd2709d
3 changed files with 99 additions and 12 deletions

View File

@@ -17,6 +17,10 @@ use DateTimeInterface;
interface PersonACLAwareRepositoryInterface
{
public const SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical';
public const SIMILAR_SEARCH_ORDER_BY_SIMILARITY = 'similarity';
public function buildAuthorizedQuery(
?string $default = null,
?string $firstname = null,
@@ -61,4 +65,13 @@ interface PersonACLAwareRepositoryInterface
?string $phonenumber = null,
?string $city = null
): array;
/**
* @return array|Person[]
*/
public function findMatchingPersons(
Person $person,
float $precision = 0.15,
string $orderBy = self::SIMILAR_SEARCH_ORDER_BY_SIMILARITY
): array;
}