mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
associate location on ms calendar remote
This commit is contained in:
@@ -359,6 +359,11 @@ class Address
|
||||
return $this->validTo;
|
||||
}
|
||||
|
||||
public function hasAddressReference(): bool
|
||||
{
|
||||
return null !== $this->getAddressReference();
|
||||
}
|
||||
|
||||
public function isNoAddress(): bool
|
||||
{
|
||||
return $this->getIsNoAddress();
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user