<?php
namespace App\Entity;
use App\Entity\Trait\CreatedAtTrait;
use App\Repository\HebergementsRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: HebergementsRepository::class)]
class Hebergements
{
use CreatedAtTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
#[Assert\Length(
min: 3,
max: 30,
minMessage: 'Le nom doit faire au moins {{ limit }} caractères',
maxMessage: 'Le nom doit faire au plus {{ limit }} caractères'
)]
private ?string $name = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
private ?string $description = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs ville est obligatoire')]
private ?string $city = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs pays est obligatoire')]
private ?string $country = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire \(nom en un seul mot separé de tirets\)')]
private ?string $slug = null;
#[ORM\Column(length: 255)]
private ?string $imageFileName = null;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
private ?array $imageFileOthers = [];
#[ORM\ManyToOne(inversedBy: 'hebergements')]
#[ORM\JoinColumn(nullable: false)]
private ?Users $users = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?CategoriesHebergements $categorieshebergements = null;
#[ORM\Column(nullable: true)]
private ?bool $bannerAutorisation = null;
#[ORM\Column(nullable: true)]
private ?bool $homeAutorisation = null;
#[ORM\Column(nullable: true)]
private ?bool $publicityAutorisation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $siteWeb = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $mediaSocial1 = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $mediaSocial2 = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $mediaSocial3 = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $mediaSocial4 = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $mediaSocial5 = null;
public function __construct()
{
$this->created_at = new \DateTimeImmutable();
/// $this->createdAt = new \DateTimeImmutable(); /////////////////
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): static
{
$this->description = $description;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): static
{
$this->city = $city;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(string $country): static
{
$this->country = $country;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): static
{
$this->slug = $slug;
return $this;
}
public function getImageFileName(): ?string
{
return $this->imageFileName;
}
public function setImageFileName(string $imageFileName): static
{
$this->imageFileName = $imageFileName;
return $this;
}
public function getImageFileOthers(): ?array
{
return $this->imageFileOthers;
}
public function setImageFileOthers(array $imageFileOthers): static
{
$this->imageFileOthers = $imageFileOthers;
return $this;
}
public function getUsers(): ?Users
{
return $this->users;
}
public function setUsers(?Users $users): static
{
$this->users = $users;
return $this;
}
public function getCategorieshebergements(): ?CategoriesHebergements
{
return $this->categorieshebergements;
}
public function setCategorieshebergements(?CategoriesHebergements $categorieshebergements): static
{
$this->categorieshebergements = $categorieshebergements;
return $this;
}
public function isBannerAutorisation(): ?bool
{
return $this->bannerAutorisation;
}
public function setBannerAutorisation(?bool $bannerAutorisation): static
{
$this->bannerAutorisation = $bannerAutorisation;
return $this;
}
public function isHomeAutorisation(): ?bool
{
return $this->homeAutorisation;
}
public function setHomeAutorisation(?bool $homeAutorisation): static
{
$this->homeAutorisation = $homeAutorisation;
return $this;
}
public function isPublicityAutorisation(): ?bool
{
return $this->publicityAutorisation;
}
public function setPublicityAutorisation(?bool $publicityAutorisation): static
{
$this->publicityAutorisation = $publicityAutorisation;
return $this;
}
public function getSiteWeb(): ?string
{
return $this->siteWeb;
}
public function setSiteWeb(?string $siteWeb): static
{
$this->siteWeb = $siteWeb;
return $this;
}
public function getMediaSocial1(): ?string
{
return $this->mediaSocial1;
}
public function setMediaSocial1(?string $mediaSocial1): static
{
$this->mediaSocial1 = $mediaSocial1;
return $this;
}
public function getMediaSocial2(): ?string
{
return $this->mediaSocial2;
}
public function setMediaSocial2(?string $mediaSocial2): static
{
$this->mediaSocial2 = $mediaSocial2;
return $this;
}
public function getMediaSocial3(): ?string
{
return $this->mediaSocial3;
}
public function setMediaSocial3(?string $mediaSocial3): static
{
$this->mediaSocial3 = $mediaSocial3;
return $this;
}
public function getMediaSocial4(): ?string
{
return $this->mediaSocial4;
}
public function setMediaSocial4(?string $mediaSocial4): static
{
$this->mediaSocial4 = $mediaSocial4;
return $this;
}
public function getMediaSocial5(): ?string
{
return $this->mediaSocial5;
}
public function setMediaSocial5(?string $mediaSocial5): static
{
$this->mediaSocial5 = $mediaSocial5;
return $this;
}
}