up routes and schema

This commit is contained in:
Tykayn 2025-02-14 11:00:20 +01:00 committed by tykayn
parent e23013825b
commit 1c700917b3
23 changed files with 1959 additions and 89 deletions

96
src/Entity/Festvial.php Normal file
View file

@ -0,0 +1,96 @@
<?php
namespace App\Entity;
use App\Repository\FestvialRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FestvialRepository::class)]
class Festvial
{
#[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 $dateCreation = null;
#[ORM\Column(nullable: true)]
private ?float $chiffreAffaire = null;
#[ORM\Column(nullable: true)]
private ?int $clientsCount = null;
#[ORM\Column(length: 500, nullable: true)]
private ?string $commentaire = null;
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 getDateCreation(): ?\DateTimeInterface
{
return $this->dateCreation;
}
public function setDateCreation(?\DateTimeInterface $dateCreation): static
{
$this->dateCreation = $dateCreation;
return $this;
}
public function getChiffreAffaire(): ?float
{
return $this->chiffreAffaire;
}
public function setChiffreAffaire(?float $chiffreAffaire): static
{
$this->chiffreAffaire = $chiffreAffaire;
return $this;
}
public function getClientsCount(): ?int
{
return $this->clientsCount;
}
public function setClientsCount(?int $clientsCount): static
{
$this->clientsCount = $clientsCount;
return $this;
}
public function getCommentaire(): ?string
{
return $this->commentaire;
}
public function setCommentaire(?string $commentaire): static
{
$this->commentaire = $commentaire;
return $this;
}
}

View file

@ -25,9 +25,16 @@ class GroupOfProducts
#[ORM\ManyToMany(targetEntity: Product::class, inversedBy: 'groupOfProducts')]
private Collection $products;
/**
* @var Collection<int, Selling>
*/
#[ORM\ManyToMany(targetEntity: Selling::class, inversedBy: 'groupOfProducts')]
private Collection $sellings;
public function __construct()
{
$this->products = new ArrayCollection();
$this->sellings = new ArrayCollection();
}
@ -75,4 +82,28 @@ class GroupOfProducts
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);
}
return $this;
}
public function removeSelling(Selling $selling): static
{
$this->sellings->removeElement($selling);
return $this;
}
}

View file

@ -3,6 +3,8 @@
namespace App\Entity;
use App\Repository\SellingRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
@ -26,6 +28,17 @@ class Selling
#[ORM\Column(nullable: true)]
private ?float $reduction = null;
/**
* @var Collection<int, GroupOfProducts>
*/
#[ORM\ManyToMany(targetEntity: GroupOfProducts::class, mappedBy: 'sellings')]
private Collection $groupOfProducts;
public function __construct()
{
$this->groupOfProducts = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
@ -78,4 +91,31 @@ class Selling
return $this;
}
/**
* @return Collection<int, GroupOfProducts>
*/
public function getGroupOfProducts(): Collection
{
return $this->groupOfProducts;
}
public function addGroupOfProduct(GroupOfProducts $groupOfProduct): static
{
if (!$this->groupOfProducts->contains($groupOfProduct)) {
$this->groupOfProducts->add($groupOfProduct);
$groupOfProduct->addSelling($this);
}
return $this;
}
public function removeGroupOfProduct(GroupOfProducts $groupOfProduct): static
{
if ($this->groupOfProducts->removeElement($groupOfProduct)) {
$groupOfProduct->removeSelling($this);
}
return $this;
}
}