src/Entity/Attribution.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AttributionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassAttributionRepository::class)]
  6. class Attribution
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column]
  11.     private ?int $id null;
  12.     #[ORM\OneToOne(inversedBy"attribution"targetEntityBillet::class)]
  13.     #[ORM\JoinColumn(nullabletrue)]
  14.     private ?Billet $billet null;
  15.     #[ORM\OneToOne(inversedBy"attribution"targetEntitySpectateur::class)]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private ?Spectateur $spectateur null;
  18.     #[ORM\ManyToOne(inversedBy"attributions"targetEntityCommande::class)]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Commande $commande null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $statut null;
  23.     public function __construct()
  24.     {
  25.         $this->statut Commande::COMMANDE_STATUS_SAISIE;
  26.     }
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     public function getBillet(): ?Billet
  32.     {
  33.         return $this->billet;
  34.     }
  35.     public function setBillet(?Billet $billet): self
  36.     {
  37.         $this->billet $billet;
  38.         // set the owning side of the relation if necessary
  39.         if (!is_null($billet) && $billet->getAttribution() !== $this) {
  40.             $billet->setAttribution($this);
  41.         }
  42.         return $this;
  43.     }
  44.     public function getSpectateur(): ?Spectateur
  45.     {
  46.         return $this->spectateur;
  47.     }
  48.     public function setSpectateur(Spectateur $spectateur): self
  49.     {
  50.         $this->spectateur $spectateur;
  51.         // set the owning side of the relation if necessary
  52.         if ($spectateur->getAttribution() !== $this) {
  53.             $spectateur->setAttribution($this);
  54.         }
  55.         return $this;
  56.     }
  57.     public function getCommande(): ?Commande
  58.     {
  59.         return $this->commande;
  60.     }
  61.     public function setCommande(?Commande $commande): self
  62.     {
  63.         $this->commande $commande;
  64.         return $this;
  65.     }
  66.     public function getStatut(): ?string
  67.     {
  68.         return $this->statut;
  69.     }
  70.     public function setStatut(string $statut): self
  71.     {
  72.         $this->statut $statut;
  73.         return $this;
  74.     }
  75. }