src/Entity/CategoryResidence.php line 14
<?phpnamespace App\Entity;use App\Repository\CategoryResidenceRepository;use App\Traits\TimeStampTrait;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: CategoryResidenceRepository::class)]#[ORM\HasLifecycleCallbacks]class CategoryResidence{use TimeStampTrait;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 100)]private ?string $libelle = null;#[ORM\Column(length: 100)]private ?string $code = null;#[ORM\Column(nullable: true)]private ?bool $status = null;#[ORM\ManyToOne(inversedBy: 'categoryResidences')]private ?User $createdBy = null;#[ORM\ManyToMany(targetEntity: Residence::class, mappedBy: 'category')]private Collection $residences;#[ORM\ManyToOne(inversedBy: 'categoryResidences')]private ?Entreprise $marchand = null;public function __construct(){$this->residences = new ArrayCollection();}public function __toString(){return $this->libelle;}/*** @return int|null*/public function getId(): ?int{return $this->id;}/*** @param int|null $id*/public function setId(?int $id): void{$this->id = $id;}/*** @return string|null*/public function getLibelle(): ?string{return $this->libelle;}/*** @param string|null $libelle*/public function setLibelle(?string $libelle): void{$this->libelle = $libelle;}/*** @return string|null*/public function getCode(): ?string{return $this->code;}/*** @param string|null $code*/public function setCode(?string $code): void{$this->code = $code;}/*** @return bool|null*/public function getStatus(): ?bool{return $this->status;}/*** @param bool|null $status*/public function setStatus(?bool $status): void{$this->status = $status;}/*** @return User|null*/public function getCreatedBy(): ?User{return $this->createdBy;}/*** @param User|null $createdBy*/public function setCreatedBy(?User $createdBy): void{$this->createdBy = $createdBy;}/*** @return Collection<int, Residence>*/public function getResidences(): Collection{return $this->residences;}public function addResidence(Residence $residence): static{if (!$this->residences->contains($residence)) {$this->residences->add($residence);$residence->addCategory($this);}return $this;}public function removeResidence(Residence $residence): static{if ($this->residences->removeElement($residence)) {$residence->removeCategory($this);}return $this;}public function getMarchand(): ?Entreprise{return $this->marchand;}public function setMarchand(?Entreprise $marchand): static{$this->marchand = $marchand;return $this;}}