<?php
// src/Entity/Attendance.php
namespace App\Entity;
use App\Repository\AttendanceRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AttendanceRepository::class)
*/
class Attendance
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* Correction 2026 : Relation pointant vers l'entité Agent
* @ORM\ManyToOne(targetEntity=Agent::class, inversedBy="attendances")
* @ORM\JoinColumn(name="agent_id", referencedColumnName="id", nullable=false)
*/
private $agent;
/**
* @ORM\Column(type="datetime")
*/
private $timestamp;
/**
* @ORM\Column(type="string", length=10)
*/
private $status;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isSynced = false;
public function getId(): ?int
{
return $this->id;
}
/**
* Getters et Setters pour l'Agent
*/
public function getAgent(): ?Agent
{
return $this->agent;
}
public function setAgent(?Agent $agent): self
{
$this->agent = $agent;
return $this;
}
public function getTimestamp(): ?\DateTimeInterface
{
return $this->timestamp;
}
public function setTimestamp(\DateTimeInterface $timestamp): self
{
$this->timestamp = $timestamp;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
public function getIsSynced(): ?bool
{
return $this->isSynced;
}
public function setIsSynced(bool $isSynced): self
{
$this->isSynced = $isSynced;
return $this;
}
}