mirror of
https://forge.chapril.org/tykayn/caisse-bliss
synced 2025-10-09 17:02:47 +02:00
up schema
This commit is contained in:
parent
17e7fce7f8
commit
8e2da4f159
20 changed files with 879 additions and 4 deletions
|
@ -34,9 +34,31 @@ class Festival
|
|||
#[ORM\ManyToOne(inversedBy: 'festivals')]
|
||||
private ?User $user = null;
|
||||
|
||||
#[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();
|
||||
$this->sellings = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
@ -121,4 +143,94 @@ class Festival
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,12 @@ class Product
|
|||
#[ORM\ManyToOne(inversedBy: 'products')]
|
||||
private ?User $user = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $image = null;
|
||||
|
||||
#[ORM\Column(length: 500, nullable: true)]
|
||||
private ?string $comment = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->groupOfProducts = new ArrayCollection();
|
||||
|
@ -151,4 +157,28 @@ class Product
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getImage(): ?string
|
||||
{
|
||||
return $this->image;
|
||||
}
|
||||
|
||||
public function setImage(string $image): static
|
||||
{
|
||||
$this->image = $image;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getComment(): ?string
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function setComment(?string $comment): static
|
||||
{
|
||||
$this->comment = $comment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,9 @@ class Selling
|
|||
#[ORM\ManyToMany(targetEntity: Product::class, inversedBy: 'sellings')]
|
||||
private Collection $products;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'sellings')]
|
||||
private ?Festival $festival = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->groupOfProducts = new ArrayCollection();
|
||||
|
@ -138,4 +141,16 @@ class Selling
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFestival(): ?Festival
|
||||
{
|
||||
return $this->festival;
|
||||
}
|
||||
|
||||
public function setFestival(?Festival $festival): static
|
||||
{
|
||||
$this->festival = $festival;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
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;
|
||||
}
|
||||
}
|
|
@ -21,6 +21,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(length: 180)]
|
||||
private ?string $email = null;
|
||||
|
||||
|
@ -39,9 +43,14 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
#[ORM\Column]
|
||||
private bool $isVerified = false;
|
||||
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
|
||||
private ?\DateTimeInterface $last_login = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'users')]
|
||||
private ?Festival $currentFestival = null;
|
||||
|
||||
|
||||
/**
|
||||
* @var Collection<int, Expense>
|
||||
*/
|
||||
|
@ -72,6 +81,13 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
#[ORM\OneToMany(targetEntity: Category::class, mappedBy: 'user')]
|
||||
private Collection $categories;
|
||||
|
||||
/**
|
||||
* @var Collection<int, SerieFestival>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: SerieFestival::class, mappedBy: 'user')]
|
||||
private Collection $seriesFestival;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->expenses = new ArrayCollection();
|
||||
|
@ -79,6 +95,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
$this->groupOfProducts = new ArrayCollection();
|
||||
$this->festivals = new ArrayCollection();
|
||||
$this->categories = new ArrayCollection();
|
||||
$this->seriesFestival = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
@ -345,4 +362,60 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, SerieFestival>
|
||||
*/
|
||||
public function getSeriesFestival(): Collection
|
||||
{
|
||||
return $this->seriesFestival;
|
||||
}
|
||||
|
||||
public function addSeriesFestival(SerieFestival $seriesFestival): static
|
||||
{
|
||||
if (!$this->seriesFestival->contains($seriesFestival)) {
|
||||
$this->seriesFestival->add($seriesFestival);
|
||||
$seriesFestival->setUser($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSeriesFestival(SerieFestival $seriesFestival): static
|
||||
{
|
||||
if ($this->seriesFestival->removeElement($seriesFestival)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($seriesFestival->getUser() === $this) {
|
||||
$seriesFestival->setUser(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getLastLogin(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->last_login;
|
||||
}
|
||||
|
||||
public function setLastLogin(?\DateTimeInterface $last_login): static
|
||||
{
|
||||
$this->last_login = $last_login;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(?string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue