src/Entity/Immobiliers.php line 15

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