<?php
namespace App\Domain\Entity\PointOfInterest;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Metadata\Post;
use App\Application\Service\URLService;
use App\Domain\Entity\Behavior\Identifiable;
use Gedmo\SoftDeleteable\Traits\SoftDeleteable;
use Gedmo\Timestampable\Traits\Timestampable;
/**
* Class Information
*
* @package App\Domain\Entity\PointOfInterest
*/
#[ApiResource(
operations : [
new Get(),
new GetCollection(),
new Post(),
],
normalizationContext : ['groups' => ['contact_information_read']],
denormalizationContext: ['groups' => ['contact_information_write']]
)]
class ContactInformation
{
use Identifiable;
use SoftDeleteable;
use Timestampable;
public function __construct(
public ?string $cityHall = null,
public ?string $email = null,
public ?string $email2 = null,
public ?string $facebook = null,
public ?string $instagram = null,
public ?string $policeOffice = null,
public ?string $referentName = null,
public ?string $telephone = null,
public ?string $telephone2 = null,
public ?string $touristOffice = null,
public ?string $twitter = null,
public ?string $website = null,
public ?string $website2 = null,
) {
$this->website = URLService::formatUrl($this->website);
$this->website2 = URLService::formatUrl($this->website2);
}
public function setWebsite(?string $url): void
{
$this->website = URLService::formatUrl($url);
}
public function setWebsite2(?string $url): void
{
$this->website2 = URLService::formatUrl($url);
}
}