mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
DX: [Address] fix inconsistencies between doctrine mapping and sql schema
DX: [Address] fix inconsistencies between doctrine mapping and sql schema Fixed: Address vue module do now set empty value to empty string instead of null DX: fixed AddressReferenceBaseImporterTest
This commit is contained in:
@@ -60,9 +60,6 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Address addr
|
||||
* @param mixed $addr
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function renderLines(Address $addr, bool $includeCityLine = true, bool $includeCountry = true): array
|
||||
@@ -98,18 +95,18 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
}
|
||||
}
|
||||
|
||||
return array_values(array_filter($lines, static fn ($l) => null !== $l));
|
||||
return array_values(array_filter($lines, static fn ($l) => '' !== (string) $l));
|
||||
}
|
||||
|
||||
public function renderStreetLine(Address $addr): ?string
|
||||
{
|
||||
if (null !== $addr->getStreet() && $addr->getStreet() !== '') {
|
||||
if ('' !== $addr->getStreet()) {
|
||||
$street = $addr->getStreet();
|
||||
} else {
|
||||
$street = '';
|
||||
}
|
||||
|
||||
if (null !== $addr->getStreetNumber() && $addr->getStreetNumber() !== '') {
|
||||
if ('' !== $addr->getStreetNumber()) {
|
||||
$streetNumber = $addr->getStreetNumber();
|
||||
} else {
|
||||
$streetNumber = '';
|
||||
@@ -146,7 +143,7 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
|
||||
private function renderBuildingLine(Address $addr): ?string
|
||||
{
|
||||
if (null !== $addr->getBuildingName() && $addr->getBuildingName() !== '') {
|
||||
if ($addr->getBuildingName() !== '') {
|
||||
$building = $addr->getBuildingName();
|
||||
} else {
|
||||
$building = '';
|
||||
@@ -172,7 +169,7 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
return $res;
|
||||
}
|
||||
|
||||
private function renderCityLine($addr): string
|
||||
private function renderCityLine(Address $addr): string
|
||||
{
|
||||
if (null !== $addr->getPostcode()) {
|
||||
$res = strtr('{postcode} {label}', [
|
||||
@@ -180,11 +177,9 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
'{label}' => $addr->getPostcode()->getName(),
|
||||
]);
|
||||
|
||||
if (null !== $addr->getPostCode()->getCountry()->getCountryCode()) {
|
||||
if ($addr->getPostCode()->getCountry()->getCountryCode() === 'FR') {
|
||||
if ($addr->getDistribution()) {
|
||||
$res = $res . ' ' . $addr->getDistribution();
|
||||
}
|
||||
if ($addr->getPostcode()->getCountry()->getCountryCode() === 'FR') {
|
||||
if ('' !== $addr->getDistribution()) {
|
||||
$res = $res . ' ' . $addr->getDistribution();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,35 +187,35 @@ class AddressRender implements ChillEntityRenderInterface
|
||||
return $res ?? '';
|
||||
}
|
||||
|
||||
private function renderCountryLine($addr): ?string
|
||||
private function renderCountryLine(Address $addr): ?string
|
||||
{
|
||||
return $this->translatableStringHelper->localize(
|
||||
$addr->getPostCode()->getCountry()->getName()
|
||||
$addr->getPostcode()->getCountry()->getName()
|
||||
);
|
||||
}
|
||||
|
||||
private function renderDeliveryLine($addr): ?string
|
||||
private function renderDeliveryLine(Address $addr): string
|
||||
{
|
||||
return $addr->getExtra();
|
||||
}
|
||||
|
||||
private function renderIntraBuildingLine($addr): ?string
|
||||
private function renderIntraBuildingLine(Address $addr): ?string
|
||||
{
|
||||
$arr = [];
|
||||
|
||||
if ($addr->getFlat()) {
|
||||
if ('' !== $addr->getFlat()) {
|
||||
$arr[] = 'appart ' . $addr->getFlat();
|
||||
}
|
||||
|
||||
if ($addr->getFloor()) {
|
||||
if ('' !== $addr->getFloor()) {
|
||||
$arr[] = 'ét ' . $addr->getFloor();
|
||||
}
|
||||
|
||||
if ($addr->getCorridor()) {
|
||||
if ('' !== $addr->getCorridor()) {
|
||||
$arr[] = 'coul ' . $addr->getCorridor();
|
||||
}
|
||||
|
||||
if ($addr->getSteps()) {
|
||||
if ('' !== $addr->getSteps()) {
|
||||
$arr[] = 'esc ' . $addr->getSteps();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user