src/Entity/Projects.php line 13

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