<?php
namespace App\Entity;
use App\Entity\Trait\CreatedAtTrait;
use App\Repository\ProjectsRepository;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: ProjectsRepository::class)]
class Projects
{
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: 50,
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(type: Types::TEXT)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
private ?string $description = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
#[Assert\Length(
min: 3,
max: 30,
minMessage: 'Le nom de la ville doit faire au moins {{ limit }} caractères',
maxMessage: 'Le nom de la ville doit faire au plus {{ limit }} caractères'
)]
private ?string $ville = null;
#[ORM\Column(length: 255)]
private ?string $imageFileName = null;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
private ?array $imageFileOthers = [];
#[ORM\ManyToOne(inversedBy: 'projects')]
#[ORM\JoinColumn(nullable: false)]
private ?Users $users = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Ce champs est obligatoire')]
#[Assert\Length(
min: 3,
max: 50,
minMessage: 'Le slug doit faire au moins {{ limit }} caractères',
maxMessage: 'Le slug doit faire au plus {{ limit }} caractères'
)]
private ?string $slug = null;
#[ORM\ManyToOne(inversedBy: 'projects')]
#[ORM\JoinColumn(nullable: false)]
private ?CategoriesProjects $categoriesprojects = null;
#[ORM\Column(length: 255)]
#[Assert\NotBlank(message: 'Le Pays est obligatoire')]
private ?string $pays = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $updatedAt = 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;
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 getVille(): ?string
{
return $this->ville;
}
public function setVille(string $ville): static
{
$this->ville = $ville;
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 getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): static
{
$this->slug = $slug;
return $this;
}
public function getCategoriesprojects(): ?CategoriesProjects
{
return $this->categoriesprojects;
}
public function setCategoriesprojects(?CategoriesProjects $categoriesprojects): static
{
$this->categoriesprojects = $categoriesprojects;
return $this;
}
public function getPays(): ?string
{
return $this->pays;
}
public function setPays(string $pays): static
{
$this->pays = $pays;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
{
$this->updatedAt = $updatedAt;
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;
}
}