mirror of
https://forge.chapril.org/tykayn/caisse-bliss
synced 2025-06-20 01:44:42 +02:00
up schema
This commit is contained in:
parent
17e7fce7f8
commit
8e2da4f159
20 changed files with 879 additions and 4 deletions
109
src/Entity/SerieFestival.php
Normal file
109
src/Entity/SerieFestival.php
Normal file
|
@ -0,0 +1,109 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\SerieFestivalRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SerieFestivalRepository::class)]
|
||||
class SerieFestival
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $name = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Festival>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Festival::class, mappedBy: 'serieFestival')]
|
||||
private Collection $festivals;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE)]
|
||||
private ?\DateTimeInterface $dateCreation = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'seriesFestival')]
|
||||
private ?User $user = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->festivals = new ArrayCollection();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Festival>
|
||||
*/
|
||||
public function getFestivals(): Collection
|
||||
{
|
||||
return $this->festivals;
|
||||
}
|
||||
|
||||
public function addFestival(Festival $festival): static
|
||||
{
|
||||
if (!$this->festivals->contains($festival)) {
|
||||
$this->festivals->add($festival);
|
||||
$festival->setSerieFestival($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeFestival(Festival $festival): static
|
||||
{
|
||||
if ($this->festivals->removeElement($festival)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($festival->getSerieFestival() === $this) {
|
||||
$festival->setSerieFestival(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDateCreation(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->dateCreation;
|
||||
}
|
||||
|
||||
public function setDateCreation(\DateTimeInterface $dateCreation): static
|
||||
{
|
||||
$this->dateCreation = $dateCreation;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(?User $user): static
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue