associate location on ms calendar remote

This commit is contained in:
2022-07-01 12:12:48 +02:00
parent 014e281d13
commit 2a6974610f
18 changed files with 359 additions and 28 deletions

View File

@@ -359,6 +359,11 @@ class Address
return $this->validTo;
}
public function hasAddressReference(): bool
{
return null !== $this->getAddressReference();
}
public function isNoAddress(): bool
{
return $this->getIsNoAddress();

View File

@@ -168,6 +168,11 @@ class AddressReference
return $this->updatedAt;
}
public function hasPoint(): bool
{
return null !== $this->getPoint();
}
public function setCreatedAt(?DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;

View File

@@ -180,6 +180,11 @@ class Location implements TrackCreationInterface, TrackUpdateInterface
return $this->updatedBy;
}
public function hasAddress(): bool
{
return null !== $this->getAddress();
}
public function setActive(bool $active): self
{
$this->active = $active;

View File

@@ -12,7 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\Templating\Entity;
use Chill\MainBundle\Entity\Address;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Symfony\Component\Templating\EngineInterface;
use function array_merge;
@@ -33,9 +33,9 @@ class AddressRender implements ChillEntityRenderInterface
private EngineInterface $templating;
private TranslatableStringHelper $translatableStringHelper;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(EngineInterface $templating, TranslatableStringHelper $translatableStringHelper)
public function __construct(EngineInterface $templating, TranslatableStringHelperInterface $translatableStringHelper)
{
$this->templating = $templating;
$this->translatableStringHelper = $translatableStringHelper;
@@ -65,7 +65,7 @@ class AddressRender implements ChillEntityRenderInterface
*
* @return string[]
*/
public function renderLines($addr): array
public function renderLines(Address $addr, bool $includeCityLine = true, bool $includeCountry = true): array
{
$lines = [];
@@ -75,14 +75,26 @@ class AddressRender implements ChillEntityRenderInterface
$lines[] = $this->renderBuildingLine($addr);
$lines[] = $this->renderStreetLine($addr);
$lines[] = $this->renderDeliveryLine($addr);
$lines[] = $this->renderCityLine($addr);
$lines[] = $this->renderCountryLine($addr);
if ($includeCityLine) {
$lines[] = $this->renderCityLine($addr);
}
if ($includeCountry) {
$lines[] = $this->renderCountryLine($addr);
}
} else {
$lines[] = $this->renderBuildingLine($addr);
$lines[] = $this->renderDeliveryLine($addr);
$lines[] = $this->renderStreetLine($addr);
$lines[] = $this->renderCityLine($addr);
$lines[] = $this->renderCountryLine($addr);
if ($includeCityLine) {
$lines[] = $this->renderCityLine($addr);
}
if ($includeCountry) {
$lines[] = $this->renderCountryLine($addr);
}
}
}