<?php
namespace App\Entity\Adherent;
use App\Repository\Adherent\OperateursRemboursementRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OperateursRemboursementRepository::class)]
class OperateursRemboursement implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $progressIdentifier;
/**
* Inverse side of Magasin::$operateursRemboursement
*
* @var Collection<int, Magasin>
*/
#[ORM\ManyToMany(targetEntity: Magasin::class, mappedBy: 'operateursRemboursement')]
private Collection $magasins;
public function __construct()
{
$this->magasins = new ArrayCollection();
}
public function __toString(): string
{
return (string)$this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getProgressIdentifier(): ?string
{
return $this->progressIdentifier;
}
public function setProgressIdentifier(?string $progressIdentifier): void
{
$this->progressIdentifier = $progressIdentifier;
}
/**
* @return Collection<int, Magasin>
*/
public function getMagasins(): Collection
{
return $this->magasins;
}
public function addMagasin(Magasin $magasin): self
{
if (!$this->magasins->contains($magasin)) {
$this->magasins->add($magasin);
// met à jour owning side
$magasin->addOperateursRemboursement($this);
}
return $this;
}
public function removeMagasin(Magasin $magasin): self
{
if ($this->magasins->removeElement($magasin)) {
// met à jour owning side
$magasin->removeOperateursRemboursement($this);
}
return $this;
}
}