<?php
namespace App\Entity\Adherent;
use App\Entity\adherent\magasin;
use App\Repository\Adherent\MagasinAlertRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: MagasinAlertRepository::class)]
#[ORM\HasLifecycleCallbacks]
class MagasinAlert
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $type = null;
#[ORM\Column]
private ?\DateTimeImmutable $updated_at = null;
#[ORM\Column]
private ?bool $active = null;
#[ORM\ManyToOne(inversedBy: 'magasinAlerts')]
#[ORM\JoinColumn(referencedColumnName: "k_adherent", nullable: false)]
private ?magasin $magasin = null;
#[ORM\PreUpdate]
public function onPreUpdateEntity(): void
{
$this->updated_at = new \DateTimeImmutable('now');
}
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeImmutable $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getMagasin(): ?magasin
{
return $this->magasin;
}
public function setMagasin(?magasin $magasin): self
{
$this->magasin = $magasin;
return $this;
}
}