<?phpnamespace App\Entity\Adherent;use App\Repository\Adherent\MagasinReseauxRepository;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: MagasinReseauxRepository::class)]class MagasinReseaux{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\ManyToOne(targetEntity: Magasin::class, inversedBy: 'magasinReseaux')] #[ORM\JoinColumn(name: 'magasin', referencedColumnName: 'k_adherent')] private $magasin; #[ORM\ManyToOne(targetEntity: Reseaux::class)] #[ORM\JoinColumn(nullable: false)] private $reseau; #[ORM\Column(type: 'datetime_immutable', nullable: true)] private $dateContract; #[ORM\Column(type: 'integer', nullable: true)] private $duration; #[ORM\Column(type: 'boolean')] private $active; public function __construct() { $this->active = false; $this->dateContract = new \DateTimeImmutable('now'); $this->duration = 0; } public function getId(): ?int { return $this->id; } /** * @return mixed */ public function getMagasin() { return $this->magasin; } /** * @param mixed $magasin */ public function setMagasin($magasin): void { $this->magasin = $magasin; } /** * @return mixed */ public function getReseau() { return $this->reseau; } /** * @param mixed $reseau */ public function setReseau($reseau): void { $this->reseau = $reseau; } public function getDateContract(): ?\DateTimeImmutable { return $this->dateContract; } public function setDateContract(\DateTimeImmutable $dateContract): self { $this->dateContract = $dateContract; return $this; } /** * @return mixed */ public function getDuration() { return $this->duration; } /** * @param mixed $duration */ public function setDuration($duration): void { $this->duration = $duration; } /** * @return false */ public function getActive(): bool { return $this->active; } /** * @param false $active */ public function setActive(bool $active): void { $this->active = $active; } public function __toString(): string { return $this->reseau->getName(); }}