<?php
namespace App\Entity;
use App\Repository\PDeviseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PDeviseRepository::class)]
class PDevise
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $designation = null;
#[ORM\Column(nullable: true)]
private ?bool $active = true;
#[ORM\OneToMany(mappedBy: 'devise', targetEntity: PBordereau::class)]
private Collection $bordereaux;
public function __construct()
{
$this->bordereaux = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDesignation(): ?string
{
return $this->designation;
}
public function setDesignation(?string $designation): self
{
$this->designation = $designation;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): self
{
$this->active = $active;
return $this;
}
/**
* @return Collection<int, PBordereau>
*/
public function getBordereaux(): Collection
{
return $this->bordereaux;
}
public function addBordereaux(PBordereau $bordereaux): static
{
if (!$this->bordereaux->contains($bordereaux)) {
$this->bordereaux->add($bordereaux);
$bordereaux->setDevise($this);
}
return $this;
}
public function removeBordereaux(PBordereau $bordereaux): static
{
if ($this->bordereaux->removeElement($bordereaux)) {
// set the owning side to null (unless already changed)
if ($bordereaux->getDevise() === $this) {
$bordereaux->setDevise(null);
}
}
return $this;
}
}