Skip to content
Snippets Groups Projects
Commit c50bd01f authored by ROUILLON Tom's avatar ROUILLON Tom
Browse files

Add Entities

parent e86d40bc
No related branches found
No related tags found
No related merge requests found
Showing with 897 additions and 1 deletion
......@@ -10,7 +10,7 @@
"doctrine/doctrine-bundle": "^2.11",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^2.17",
"nelmio/api-doc-bundle": "*",
"nelmio/api-doc-bundle": "^4.18",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpdoc-parser": "^1.25",
"symfony/asset": "7.0.*",
......
......
......@@ -3,6 +3,8 @@
namespace App\Entity;
use App\Repository\AdherentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
......@@ -65,6 +67,14 @@ class Adherent
#[ORM\Column(nullable: true)]
private ?bool $adhesionAJour = null;
#[ORM\ManyToMany(targetEntity: Groupe::class, mappedBy: 'appartient')]
private Collection $groupes;
public function __construct()
{
$this->groupes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
......@@ -280,4 +290,31 @@ class Adherent
return $this;
}
/**
* @return Collection<int, Groupe>
*/
public function getGroupes(): Collection
{
return $this->groupes;
}
public function addGroupe(Groupe $groupe): static
{
if (!$this->groupes->contains($groupe)) {
$this->groupes->add($groupe);
$groupe->addAppartient($this);
}
return $this;
}
public function removeGroupe(Groupe $groupe): static
{
if ($this->groupes->removeElement($groupe)) {
$groupe->removeAppartient($this);
}
return $this;
}
}
<?php
namespace App\Entity;
use App\Repository\AdhesionRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AdhesionRepository::class)]
class Adhesion
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $type = null;
#[ORM\Column]
private ?float $prix = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $dateCharniere = null;
#[ORM\Column]
private ?bool $active = null;
#[ORM\ManyToOne(inversedBy: 'adhesions')]
#[ORM\JoinColumn(nullable: false)]
private ?Periode $periode_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Structure $structure_id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
private ?Adherent $adherent_id = null;
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): static
{
$this->type = $type;
return $this;
}
public function getPrix(): ?float
{
return $this->prix;
}
public function setPrix(float $prix): static
{
$this->prix = $prix;
return $this;
}
public function getDateCharniere(): ?\DateTimeInterface
{
return $this->dateCharniere;
}
public function setDateCharniere(\DateTimeInterface $dateCharniere): static
{
$this->dateCharniere = $dateCharniere;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): static
{
$this->active = $active;
return $this;
}
public function getPeriodeId(): ?Periode
{
return $this->periode_id;
}
public function setPeriodeId(?Periode $periode_id): static
{
$this->periode_id = $periode_id;
return $this;
}
public function getStructureId(): ?Structure
{
return $this->structure_id;
}
public function setStructureId(?Structure $structure_id): static
{
$this->structure_id = $structure_id;
return $this;
}
public function getAdherentId(): ?Adherent
{
return $this->adherent_id;
}
public function setAdherentId(?Adherent $adherent_id): static
{
$this->adherent_id = $adherent_id;
return $this;
}
}
<?php
namespace App\Entity;
use App\Repository\GroupeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: GroupeRepository::class)]
class Groupe
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 100)]
private ?string $nom = null;
#[ORM\Column(length: 255)]
private ?string $droit1 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $droit2 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $droit3 = null;
#[ORM\ManyToMany(targetEntity: Adherent::class, inversedBy: 'groupes')]
private Collection $appartient;
public function __construct()
{
$this->appartient = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): static
{
$this->nom = $nom;
return $this;
}
public function getDroit1(): ?string
{
return $this->droit1;
}
public function setDroit1(string $droit1): static
{
$this->droit1 = $droit1;
return $this;
}
public function getDroit2(): ?string
{
return $this->droit2;
}
public function setDroit2(?string $droit2): static
{
$this->droit2 = $droit2;
return $this;
}
public function getDroit3(): ?string
{
return $this->droit3;
}
public function setDroit3(?string $droit3): static
{
$this->droit3 = $droit3;
return $this;
}
/**
* @return Collection<int, Adherent>
*/
public function getAppartient(): Collection
{
return $this->appartient;
}
public function addAppartient(Adherent $appartient): static
{
if (!$this->appartient->contains($appartient)) {
$this->appartient->add($appartient);
}
return $this;
}
public function removeAppartient(Adherent $appartient): static
{
$this->appartient->removeElement($appartient);
return $this;
}
}
<?php
namespace App\Entity;
use App\Repository\JourCalendrierRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: JourCalendrierRepository::class)]
class JourCalendrier
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $date = null;
#[ORM\Column(nullable: true)]
private ?bool $livrable = null;
#[ORM\ManyToOne(inversedBy: 'jourCalendriers')]
private ?Structure $structure_id = null;
public function getId(): ?int
{
return $this->id;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): static
{
$this->date = $date;
return $this;
}
public function isLivrable(): ?bool
{
return $this->livrable;
}
public function setLivrable(?bool $livrable): static
{
$this->livrable = $livrable;
return $this;
}
public function getStructureId(): ?Structure
{
return $this->structure_id;
}
public function setStructureId(?Structure $structure_id): static
{
$this->structure_id = $structure_id;
return $this;
}
}
<?php
namespace App\Entity;
use App\Repository\PeriodeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PeriodeRepository::class)]
class Periode
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $debut = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $fin = null;
#[ORM\OneToMany(mappedBy: 'periode_id', targetEntity: Adhesion::class)]
private Collection $adhesions;
public function __construct()
{
$this->adhesions = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getDebut(): ?\DateTimeInterface
{
return $this->debut;
}
public function setDebut(\DateTimeInterface $debut): static
{
$this->debut = $debut;
return $this;
}
public function getFin(): ?\DateTimeInterface
{
return $this->fin;
}
public function setFin(\DateTimeInterface $fin): static
{
$this->fin = $fin;
return $this;
}
/**
* @return Collection<int, Adhesion>
*/
public function getAdhesions(): Collection
{
return $this->adhesions;
}
public function addAdhesion(Adhesion $adhesion): static
{
if (!$this->adhesions->contains($adhesion)) {
$this->adhesions->add($adhesion);
$adhesion->setPeriodeId($this);
}
return $this;
}
public function removeAdhesion(Adhesion $adhesion): static
{
if ($this->adhesions->removeElement($adhesion)) {
// set the owning side to null (unless already changed)
if ($adhesion->getPeriodeId() === $this) {
$adhesion->setPeriodeId(null);
}
}
return $this;
}
}
<?php
namespace App\Entity;
use App\Repository\StructureRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: StructureRepository::class)]
class Structure
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $idStructure = null;
#[ORM\Column(length: 45)]
private ?string $nom = null;
#[ORM\Column(length: 45)]
private ?string $ville = null;
#[ORM\Column(length: 255)]
private ?string $raisonSoc = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $siege = null;
#[ORM\Column(length: 255)]
private ?string $adresse = null;
#[ORM\Column(length: 20)]
private ?string $telephone = null;
#[ORM\Column(length: 45)]
private ?string $mail = null;
#[ORM\Column(length: 100)]
private ?string $nomContact = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $siteWeb = null;
#[ORM\OneToMany(mappedBy: 'structure_id', targetEntity: JourCalendrier::class)]
private Collection $jourCalendriers;
public function __construct()
{
$this->jourCalendriers = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getIdStructure(): ?int
{
return $this->idStructure;
}
public function setIdStructure(int $idStructure): static
{
$this->idStructure = $idStructure;
return $this;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): static
{
$this->nom = $nom;
return $this;
}
public function getVille(): ?string
{
return $this->ville;
}
public function setVille(string $ville): static
{
$this->ville = $ville;
return $this;
}
public function getRaisonSoc(): ?string
{
return $this->raisonSoc;
}
public function setRaisonSoc(string $raisonSoc): static
{
$this->raisonSoc = $raisonSoc;
return $this;
}
public function getSiege(): ?string
{
return $this->siege;
}
public function setSiege(?string $siege): static
{
$this->siege = $siege;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(string $adresse): static
{
$this->adresse = $adresse;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(string $telephone): static
{
$this->telephone = $telephone;
return $this;
}
public function getMail(): ?string
{
return $this->mail;
}
public function setMail(string $mail): static
{
$this->mail = $mail;
return $this;
}
public function getNomContact(): ?string
{
return $this->nomContact;
}
public function setNomContact(string $nomContact): static
{
$this->nomContact = $nomContact;
return $this;
}
public function getSiteWeb(): ?string
{
return $this->siteWeb;
}
public function setSiteWeb(?string $siteWeb): static
{
$this->siteWeb = $siteWeb;
return $this;
}
/**
* @return Collection<int, JourCalendrier>
*/
public function getJourCalendriers(): Collection
{
return $this->jourCalendriers;
}
public function addJourCalendrier(JourCalendrier $jourCalendrier): static
{
if (!$this->jourCalendriers->contains($jourCalendrier)) {
$this->jourCalendriers->add($jourCalendrier);
$jourCalendrier->setStructureId($this);
}
return $this;
}
public function removeJourCalendrier(JourCalendrier $jourCalendrier): static
{
if ($this->jourCalendriers->removeElement($jourCalendrier)) {
// set the owning side to null (unless already changed)
if ($jourCalendrier->getStructureId() === $this) {
$jourCalendrier->setStructureId(null);
}
}
return $this;
}
}
<?php
namespace App\Repository;
use App\Entity\Adhesion;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Adhesion>
*
* @method Adhesion|null find($id, $lockMode = null, $lockVersion = null)
* @method Adhesion|null findOneBy(array $criteria, array $orderBy = null)
* @method Adhesion[] findAll()
* @method Adhesion[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class AdhesionRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Adhesion::class);
}
// /**
// * @return Adhesion[] Returns an array of Adhesion objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('a')
// ->andWhere('a.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('a.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Adhesion
// {
// return $this->createQueryBuilder('a')
// ->andWhere('a.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}
<?php
namespace App\Repository;
use App\Entity\Groupe;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Groupe>
*
* @method Groupe|null find($id, $lockMode = null, $lockVersion = null)
* @method Groupe|null findOneBy(array $criteria, array $orderBy = null)
* @method Groupe[] findAll()
* @method Groupe[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class GroupeRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Groupe::class);
}
// /**
// * @return Groupe[] Returns an array of Groupe objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('g')
// ->andWhere('g.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('g.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Groupe
// {
// return $this->createQueryBuilder('g')
// ->andWhere('g.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}
<?php
namespace App\Repository;
use App\Entity\JourCalendrier;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<JourCalendrier>
*
* @method JourCalendrier|null find($id, $lockMode = null, $lockVersion = null)
* @method JourCalendrier|null findOneBy(array $criteria, array $orderBy = null)
* @method JourCalendrier[] findAll()
* @method JourCalendrier[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class JourCalendrierRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, JourCalendrier::class);
}
// /**
// * @return JourCalendrier[] Returns an array of JourCalendrier objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('j')
// ->andWhere('j.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('j.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?JourCalendrier
// {
// return $this->createQueryBuilder('j')
// ->andWhere('j.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}
<?php
namespace App\Repository;
use App\Entity\Periode;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Periode>
*
* @method Periode|null find($id, $lockMode = null, $lockVersion = null)
* @method Periode|null findOneBy(array $criteria, array $orderBy = null)
* @method Periode[] findAll()
* @method Periode[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class PeriodeRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Periode::class);
}
// /**
// * @return Periode[] Returns an array of Periode objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('p.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Periode
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}
<?php
namespace App\Repository;
use App\Entity\Structure;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Structure>
*
* @method Structure|null find($id, $lockMode = null, $lockVersion = null)
* @method Structure|null findOneBy(array $criteria, array $orderBy = null)
* @method Structure[] findAll()
* @method Structure[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class StructureRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Structure::class);
}
// /**
// * @return Structure[] Returns an array of Structure objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('s.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Structure
// {
// return $this->createQueryBuilder('s')
// ->andWhere('s.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}
......@@ -26,6 +26,15 @@
"./migrations/.gitignore"
]
},
"nelmio/api-doc-bundle": {
"version": "4.18",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "3.0",
"ref": "c8e0c38e1a280ab9e37587a8fa32b251d5bc1c94"
}
},
"phpunit/phpunit": {
"version": "9.6",
"recipe": {
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment