src/Entity/Adherent/MagasinReseaux.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Adherent;
  3. use App\Repository\Adherent\MagasinReseauxRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassMagasinReseauxRepository::class)]
  6. class MagasinReseaux
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityMagasin::class, inversedBy'magasinReseaux')]
  13.     #[ORM\JoinColumn(name'magasin'referencedColumnName'k_adherent')]
  14.     private $magasin;
  15.     #[ORM\ManyToOne(targetEntityReseaux::class)]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private $reseau;
  18.     #[ORM\Column(type'datetime_immutable'nullabletrue)]
  19.     private $dateContract;
  20.     #[ORM\Column(type'integer'nullabletrue)]
  21.     private $duration;
  22.     #[ORM\Column(type'boolean')]
  23.     private $active;
  24.     public function __construct()
  25.     {
  26.         $this->active false;
  27.         $this->dateContract = new \DateTimeImmutable('now');
  28.         $this->duration 0;
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     /**
  35.      * @return mixed
  36.      */
  37.     public function getMagasin()
  38.     {
  39.         return $this->magasin;
  40.     }
  41.     /**
  42.      * @param mixed $magasin
  43.      */
  44.     public function setMagasin($magasin): void
  45.     {
  46.         $this->magasin $magasin;
  47.     }
  48.     /**
  49.      * @return mixed
  50.      */
  51.     public function getReseau()
  52.     {
  53.         return $this->reseau;
  54.     }
  55.     /**
  56.      * @param mixed $reseau
  57.      */
  58.     public function setReseau($reseau): void
  59.     {
  60.         $this->reseau $reseau;
  61.     }
  62.     public function getDateContract(): ?\DateTimeImmutable
  63.     {
  64.         return $this->dateContract;
  65.     }
  66.     public function setDateContract(\DateTimeImmutable $dateContract): self
  67.     {
  68.         $this->dateContract $dateContract;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return mixed
  73.      */
  74.     public function getDuration()
  75.     {
  76.         return $this->duration;
  77.     }
  78.     /**
  79.      * @param mixed $duration
  80.      */
  81.     public function setDuration($duration): void
  82.     {
  83.         $this->duration $duration;
  84.     }
  85.     /**
  86.      * @return false
  87.      */
  88.     public function getActive(): bool
  89.     {
  90.         return $this->active;
  91.     }
  92.     /**
  93.      * @param false $active
  94.      */
  95.     public function setActive(bool $active): void
  96.     {
  97.         $this->active $active;
  98.     }
  99.     public function __toString(): string
  100.     {
  101.         return $this->reseau->getName();
  102.     }
  103. }