src/Entity/Hebergements.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\CreatedAtTrait;
  4. use App\Repository\HebergementsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. #[ORM\Entity(repositoryClassHebergementsRepository::class)]
  9. class Hebergements
  10. {
  11.     use CreatedAtTrait;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255)]
  17.     #[Assert\NotBlank(message'Ce champs est obligatoire')]
  18.     #[Assert\Length(
  19.         min3,
  20.         max30,
  21.         minMessage'Le nom doit faire au moins {{ limit }} caractères',
  22.         maxMessage'Le nom doit faire au plus {{ limit }} caractères'
  23.     )]
  24.     private ?string $name null;
  25.     #[ORM\Column(length255)]
  26.     #[Assert\NotBlank(message'Ce champs est obligatoire')]
  27.     private ?string $description null;
  28.     #[ORM\Column(length255)]
  29.     #[Assert\NotBlank(message'Ce champs ville est obligatoire')]
  30.     private ?string $city null;
  31.     #[ORM\Column(length255)]
  32.     #[Assert\NotBlank(message'Ce champs pays est obligatoire')]
  33.     private ?string $country null;
  34.     #[ORM\Column(length255)]
  35.     #[Assert\NotBlank(message'Ce champs est obligatoire \(nom en un seul mot separé de tirets\)')]
  36.     private ?string $slug null;
  37.     #[ORM\Column(length255)]
  38.     private ?string $imageFileName null;
  39.     #[ORM\Column(typeTypes::ARRAY, nullabletrue)]
  40.     private ?array $imageFileOthers = [];
  41.     #[ORM\ManyToOne(inversedBy'hebergements')]
  42.     #[ORM\JoinColumn(nullablefalse)]
  43.     private ?Users $users null;
  44.     #[ORM\ManyToOne]
  45.     #[ORM\JoinColumn(nullablefalse)]
  46.     private ?CategoriesHebergements $categorieshebergements null;
  47.     #[ORM\Column(nullabletrue)]
  48.     private ?bool $bannerAutorisation null;
  49.     #[ORM\Column(nullabletrue)]
  50.     private ?bool $homeAutorisation null;
  51.     #[ORM\Column(nullabletrue)]
  52.     private ?bool $publicityAutorisation null;
  53.     #[ORM\Column(length255nullabletrue)]
  54.     private ?string $siteWeb null;
  55.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  56.     private ?string $mediaSocial1 null;
  57.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  58.     private ?string $mediaSocial2 null;
  59.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  60.     private ?string $mediaSocial3 null;
  61.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  62.     private ?string $mediaSocial4 null;
  63.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  64.     private ?string $mediaSocial5 null;
  65.     public function __construct()
  66.     {
  67.         $this->created_at = new \DateTimeImmutable();
  68.         /// $this->createdAt = new \DateTimeImmutable(); /////////////////
  69.     }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getName(): ?string
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function setName(string $name): static
  79.     {
  80.         $this->name $name;
  81.         return $this;
  82.     }
  83.     public function getDescription(): ?string
  84.     {
  85.         return $this->description;
  86.     }
  87.     public function setDescription(string $description): static
  88.     {
  89.         $this->description $description;
  90.         return $this;
  91.     }
  92.     public function getCity(): ?string
  93.     {
  94.         return $this->city;
  95.     }
  96.     public function setCity(string $city): static
  97.     {
  98.         $this->city $city;
  99.         return $this;
  100.     }
  101.     public function getCountry(): ?string
  102.     {
  103.         return $this->country;
  104.     }
  105.     public function setCountry(string $country): static
  106.     {
  107.         $this->country $country;
  108.         return $this;
  109.     }
  110.     public function getSlug(): ?string
  111.     {
  112.         return $this->slug;
  113.     }
  114.     public function setSlug(string $slug): static
  115.     {
  116.         $this->slug $slug;
  117.         return $this;
  118.     }
  119.     public function getImageFileName(): ?string
  120.     {
  121.         return $this->imageFileName;
  122.     }
  123.     public function setImageFileName(string $imageFileName): static
  124.     {
  125.         $this->imageFileName $imageFileName;
  126.         return $this;
  127.     }
  128.     public function getImageFileOthers(): ?array
  129.     {
  130.         return $this->imageFileOthers;
  131.     }
  132.     public function setImageFileOthers(array $imageFileOthers): static
  133.     {
  134.         $this->imageFileOthers $imageFileOthers;
  135.         return $this;
  136.     }
  137.     public function getUsers(): ?Users
  138.     {
  139.         return $this->users;
  140.     }
  141.     public function setUsers(?Users $users): static
  142.     {
  143.         $this->users $users;
  144.         return $this;
  145.     }
  146.     public function getCategorieshebergements(): ?CategoriesHebergements
  147.     {
  148.         return $this->categorieshebergements;
  149.     }
  150.     public function setCategorieshebergements(?CategoriesHebergements $categorieshebergements): static
  151.     {
  152.         $this->categorieshebergements $categorieshebergements;
  153.         return $this;
  154.     }
  155.     public function isBannerAutorisation(): ?bool
  156.     {
  157.         return $this->bannerAutorisation;
  158.     }
  159.     public function setBannerAutorisation(?bool $bannerAutorisation): static
  160.     {
  161.         $this->bannerAutorisation $bannerAutorisation;
  162.         return $this;
  163.     }
  164.     public function isHomeAutorisation(): ?bool
  165.     {
  166.         return $this->homeAutorisation;
  167.     }
  168.     public function setHomeAutorisation(?bool $homeAutorisation): static
  169.     {
  170.         $this->homeAutorisation $homeAutorisation;
  171.         return $this;
  172.     }
  173.     public function isPublicityAutorisation(): ?bool
  174.     {
  175.         return $this->publicityAutorisation;
  176.     }
  177.     public function setPublicityAutorisation(?bool $publicityAutorisation): static
  178.     {
  179.         $this->publicityAutorisation $publicityAutorisation;
  180.         return $this;
  181.     }
  182.     public function getSiteWeb(): ?string
  183.     {
  184.         return $this->siteWeb;
  185.     }
  186.     public function setSiteWeb(?string $siteWeb): static
  187.     {
  188.         $this->siteWeb $siteWeb;
  189.         return $this;
  190.     }
  191.     public function getMediaSocial1(): ?string
  192.     {
  193.         return $this->mediaSocial1;
  194.     }
  195.     public function setMediaSocial1(?string $mediaSocial1): static
  196.     {
  197.         $this->mediaSocial1 $mediaSocial1;
  198.         return $this;
  199.     }
  200.     public function getMediaSocial2(): ?string
  201.     {
  202.         return $this->mediaSocial2;
  203.     }
  204.     public function setMediaSocial2(?string $mediaSocial2): static
  205.     {
  206.         $this->mediaSocial2 $mediaSocial2;
  207.         return $this;
  208.     }
  209.     public function getMediaSocial3(): ?string
  210.     {
  211.         return $this->mediaSocial3;
  212.     }
  213.     public function setMediaSocial3(?string $mediaSocial3): static
  214.     {
  215.         $this->mediaSocial3 $mediaSocial3;
  216.         return $this;
  217.     }
  218.     public function getMediaSocial4(): ?string
  219.     {
  220.         return $this->mediaSocial4;
  221.     }
  222.     public function setMediaSocial4(?string $mediaSocial4): static
  223.     {
  224.         $this->mediaSocial4 $mediaSocial4;
  225.         return $this;
  226.     }
  227.     public function getMediaSocial5(): ?string
  228.     {
  229.         return $this->mediaSocial5;
  230.     }
  231.     public function setMediaSocial5(?string $mediaSocial5): static
  232.     {
  233.         $this->mediaSocial5 $mediaSocial5;
  234.         return $this;
  235.     }
  236. }