<?php
namespace App\Entity;
use App\Repository\AttributionRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AttributionRepository::class)]
class Attribution
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\OneToOne(inversedBy: "attribution", targetEntity: Billet::class)]
#[ORM\JoinColumn(nullable: true)]
private ?Billet $billet = null;
#[ORM\OneToOne(inversedBy: "attribution", targetEntity: Spectateur::class)]
#[ORM\JoinColumn(nullable: false)]
private ?Spectateur $spectateur = null;
#[ORM\ManyToOne(inversedBy: "attributions", targetEntity: Commande::class)]
#[ORM\JoinColumn(nullable: false)]
private ?Commande $commande = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $statut = null;
public function __construct()
{
$this->statut = Commande::COMMANDE_STATUS_SAISIE;
}
public function getId(): ?int
{
return $this->id;
}
public function getBillet(): ?Billet
{
return $this->billet;
}
public function setBillet(?Billet $billet): self
{
$this->billet = $billet;
// set the owning side of the relation if necessary
if (!is_null($billet) && $billet->getAttribution() !== $this) {
$billet->setAttribution($this);
}
return $this;
}
public function getSpectateur(): ?Spectateur
{
return $this->spectateur;
}
public function setSpectateur(Spectateur $spectateur): self
{
$this->spectateur = $spectateur;
// set the owning side of the relation if necessary
if ($spectateur->getAttribution() !== $this) {
$spectateur->setAttribution($this);
}
return $this;
}
public function getCommande(): ?Commande
{
return $this->commande;
}
public function setCommande(?Commande $commande): self
{
$this->commande = $commande;
return $this;
}
public function getStatut(): ?string
{
return $this->statut;
}
public function setStatut(string $statut): self
{
$this->statut = $statut;
return $this;
}
}