<?php
namespace App\Entity;
use App\Repository\ProjetsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProjetsRepository::class)]
class Projets
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nom = null;
#[ORM\Column(length: 255)]
private ?string $moa = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $dateCreation = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $dateAchevement = null;
#[ORM\ManyToOne]
private ?User $user = null;
#[ORM\OneToMany(mappedBy: 'projets', targetEntity: Logements::class)]
private Collection $logements;
#[ORM\Column(length: 255)]
private ?string $nomEntreprise = null;
#[ORM\Column]
private ?bool $actif = null;
public function __construct()
{
$this->logements = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
public function getMoa(): ?string
{
return $this->moa;
}
public function setMoa(string $moa): self
{
$this->moa = $moa;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->dateCreation;
}
public function setDateCreation(\DateTimeInterface $dateCreation): self
{
$this->dateCreation = $dateCreation;
return $this;
}
public function getDateAchevement(): ?\DateTimeInterface
{
return $this->dateAchevement;
}
public function setDateAchevement(\DateTimeInterface $dateAchevement): self
{
$this->dateAchevement = $dateAchevement;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
/**
* @return Collection<int, Logements>
*/
public function getLogements(): Collection
{
return $this->logements;
}
public function addLogement(Logements $logement): self
{
if (!$this->logements->contains($logement)) {
$this->logements->add($logement);
$logement->setProjets($this);
}
return $this;
}
public function removeLogement(Logements $logement): self
{
if ($this->logements->removeElement($logement)) {
// set the owning side to null (unless already changed)
if ($logement->getProjets() === $this) {
$logement->setProjets(null);
}
}
return $this;
}
public function getNomEntreprise(): ?string
{
return $this->nomEntreprise;
}
public function setNomEntreprise(string $nomEntreprise): self
{
$this->nomEntreprise = $nomEntreprise;
return $this;
}
public function isActif(): ?bool
{
return $this->actif;
}
public function setActif(bool $actif): self
{
$this->actif = $actif;
return $this;
}
}