mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
Merge branch 'master' into calendar/finalization
This commit is contained in:
commit
cec1588e91
@ -119,8 +119,8 @@ final class PostalCodeRepository implements ObjectRepository
|
|||||||
|
|
||||||
$pertinenceClause = ['STRICT_WORD_SIMILARITY(canonical, UNACCENT(?))'];
|
$pertinenceClause = ['STRICT_WORD_SIMILARITY(canonical, UNACCENT(?))'];
|
||||||
$pertinenceArgs = [$pattern];
|
$pertinenceArgs = [$pattern];
|
||||||
$orWhere = ['canonical %>> UNACCENT(?)'];
|
$andWhere = ['canonical %>> UNACCENT(?)'];
|
||||||
$orWhereArgs = [$pattern];
|
$andWhereArgs = [$pattern];
|
||||||
|
|
||||||
foreach (explode(' ', $pattern) as $part) {
|
foreach (explode(' ', $pattern) as $part) {
|
||||||
$part = trim($part);
|
$part = trim($part);
|
||||||
@ -129,8 +129,8 @@ final class PostalCodeRepository implements ObjectRepository
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$orWhere[] = "canonical LIKE '%' || UNACCENT(LOWER(?)) || '%'";
|
$andWhere[] = "canonical LIKE '%' || UNACCENT(LOWER(?)) || '%'";
|
||||||
$orWhereArgs[] = $part;
|
$andWhereArgs[] = $part;
|
||||||
$pertinenceClause[] =
|
$pertinenceClause[] =
|
||||||
"(EXISTS (SELECT 1 FROM unnest(string_to_array(canonical, ' ')) AS t WHERE starts_with(t, UNACCENT(LOWER(?)))))::int";
|
"(EXISTS (SELECT 1 FROM unnest(string_to_array(canonical, ' ')) AS t WHERE starts_with(t, UNACCENT(LOWER(?)))))::int";
|
||||||
$pertinenceClause[] =
|
$pertinenceClause[] =
|
||||||
@ -139,7 +139,7 @@ final class PostalCodeRepository implements ObjectRepository
|
|||||||
}
|
}
|
||||||
$query
|
$query
|
||||||
->setSelectPertinence(implode(' + ', $pertinenceClause), $pertinenceArgs)
|
->setSelectPertinence(implode(' + ', $pertinenceClause), $pertinenceArgs)
|
||||||
->andWhereClause(implode(' OR ', $orWhere), $orWhereArgs);
|
->andWhereClause(implode(' AND ', $andWhere), $andWhereArgs);
|
||||||
|
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
@ -1192,7 +1192,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated Use `getCurrentPersonAddress` instead
|
* @deprecated Use @link{Person::getCurrentPersonAddress} or @link{Person::getCurrentHouseholdAddress} instead
|
||||||
*
|
*
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*
|
*
|
||||||
@ -1200,7 +1200,9 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
*/
|
*/
|
||||||
public function getLastAddress(?DateTime $from = null)
|
public function getLastAddress(?DateTime $from = null)
|
||||||
{
|
{
|
||||||
return $this->getCurrentPersonAddress();
|
return $this->getCurrentHouseholdAddress(
|
||||||
|
null !== $from ? DateTimeImmutable::createFromMutable($from) : null
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLastName(): string
|
public function getLastName(): string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user