caisse-bliss/src/Entity/Festival.php

237 lines
5.2 KiB
PHP
Raw Normal View History

2025-02-09 16:05:39 +01:00
<?php
namespace App\Entity;
use App\Repository\FestivalRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
2025-02-09 16:05:39 +01:00
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FestivalRepository::class)]
class Festival
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
private ?\DateTimeInterface $date_start = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $date_end = null;
/**
* @var Collection<int, User>
*/
#[ORM\OneToMany(targetEntity: User::class, mappedBy: 'currentFestival')]
private Collection $users;
#[ORM\ManyToOne(inversedBy: 'festivals')]
private ?User $user = null;
2025-02-14 12:35:48 +01:00
#[ORM\Column(nullable: true)]
private ?float $fraisInscription = null;
#[ORM\Column(nullable: true)]
private ?float $fondDeCaisseAvant = null;
#[ORM\Column(nullable: true)]
private ?float $fondDeCaisseApres = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $dateCreation = null;
/**
* @var Collection<int, Selling>
*/
#[ORM\OneToMany(targetEntity: Selling::class, mappedBy: 'festival')]
private Collection $sellings;
#[ORM\ManyToOne(inversedBy: 'festivals')]
private ?SerieFestival $serieFestival = null;
public function __construct()
{
$this->users = new ArrayCollection();
2025-02-14 12:35:48 +01:00
$this->sellings = new ArrayCollection();
}
2025-02-09 16:05:39 +01:00
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getDateStart(): ?\DateTimeInterface
{
return $this->date_start;
}
public function setDateStart(?\DateTimeInterface $date_start): static
{
$this->date_start = $date_start;
return $this;
}
public function getDateEnd(): ?\DateTimeInterface
{
return $this->date_end;
}
public function setDateEnd(\DateTimeInterface $date_end): static
{
$this->date_end = $date_end;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): static
{
if (!$this->users->contains($user)) {
$this->users->add($user);
$user->setCurrentFestival($this);
}
return $this;
}
public function removeUser(User $user): static
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getCurrentFestival() === $this) {
$user->setCurrentFestival(null);
}
}
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
2025-02-14 12:35:48 +01:00
public function getFraisInscription(): ?float
{
return $this->fraisInscription;
}
public function setFraisInscription(?float $fraisInscription): static
{
$this->fraisInscription = $fraisInscription;
return $this;
}
public function getFondDeCaisseAvant(): ?float
{
return $this->fondDeCaisseAvant;
}
public function setFondDeCaisseAvant(?float $fondDeCaisseAvant): static
{
$this->fondDeCaisseAvant = $fondDeCaisseAvant;
return $this;
}
public function getFondDeCaisseApres(): ?float
{
return $this->fondDeCaisseApres;
}
public function setFondDeCaisseApres(?float $fondDeCaisseApres): static
{
$this->fondDeCaisseApres = $fondDeCaisseApres;
return $this;
}
public function getDateCreation(): ?\DateTimeInterface
{
return $this->dateCreation;
}
public function setDateCreation(\DateTimeInterface $dateCreation): static
{
$this->dateCreation = $dateCreation;
return $this;
}
/**
* @return Collection<int, Selling>
*/
public function getSellings(): Collection
{
return $this->sellings;
}
public function addSelling(Selling $selling): static
{
if (!$this->sellings->contains($selling)) {
$this->sellings->add($selling);
$selling->setFestival($this);
}
return $this;
}
public function removeSelling(Selling $selling): static
{
if ($this->sellings->removeElement($selling)) {
// set the owning side to null (unless already changed)
if ($selling->getFestival() === $this) {
$selling->setFestival(null);
}
}
return $this;
}
public function getSerieFestival(): ?SerieFestival
{
return $this->serieFestival;
}
public function setSerieFestival(?SerieFestival $serieFestival): static
{
$this->serieFestival = $serieFestival;
return $this;
}
2025-02-09 16:05:39 +01:00
}