src/Entity/Adherent/OperateursRemboursement.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Adherent;
  3. use App\Repository\Adherent\OperateursRemboursementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassOperateursRemboursementRepository::class)]
  8. class OperateursRemboursement implements \Stringable
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $progressIdentifier;
  18.     /**
  19.      * Inverse side of Magasin::$operateursRemboursement
  20.      *
  21.      * @var Collection<int, Magasin>
  22.      */
  23.     #[ORM\ManyToMany(targetEntityMagasin::class, mappedBy'operateursRemboursement')]
  24.     private Collection $magasins;
  25.     public function __construct()
  26.     {
  27.         $this->magasins = new ArrayCollection();
  28.     }
  29.     public function __toString(): string
  30.     {
  31.         return (string)$this->name;
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getName(): ?string
  38.     {
  39.         return $this->name;
  40.     }
  41.     public function setName(string $name): self
  42.     {
  43.         $this->name $name;
  44.         return $this;
  45.     }
  46.     public function getProgressIdentifier(): ?string
  47.     {
  48.         return $this->progressIdentifier;
  49.     }
  50.     public function setProgressIdentifier(?string $progressIdentifier): void
  51.     {
  52.         $this->progressIdentifier $progressIdentifier;
  53.     }
  54.     /**
  55.      * @return Collection<int, Magasin>
  56.      */
  57.     public function getMagasins(): Collection
  58.     {
  59.         return $this->magasins;
  60.     }
  61.     public function addMagasin(Magasin $magasin): self
  62.     {
  63.         if (!$this->magasins->contains($magasin)) {
  64.             $this->magasins->add($magasin);
  65. // met à jour owning side
  66.             $magasin->addOperateursRemboursement($this);
  67.         }
  68.         return $this;
  69.     }
  70.     public function removeMagasin(Magasin $magasin): self
  71.     {
  72.         if ($this->magasins->removeElement($magasin)) {
  73. // met à jour owning side
  74.             $magasin->removeOperateursRemboursement($this);
  75.         }
  76.         return $this;
  77.     }
  78. }