diff --git a/Back_end/src/Entity/Livraison.php b/Back_end/src/Entity/Livraison.php new file mode 100644 index 0000000000000000000000000000000000000000..c09941158b2a2def4113d14d3537fad93a55bb13 --- /dev/null +++ b/Back_end/src/Entity/Livraison.php @@ -0,0 +1,20 @@ +<?php + +namespace App\Entity; + +use App\Repository\LivraisonRepository; +use Doctrine\ORM\Mapping as ORM; + +#[ORM\Entity(repositoryClass: LivraisonRepository::class)] +class Livraison +{ + #[ORM\Id] + #[ORM\GeneratedValue] + #[ORM\Column] + private ?int $id = null; + + public function getId(): ?int + { + return $this->id; + } +} diff --git a/Back_end/src/Entity/OrdreTournee.php b/Back_end/src/Entity/OrdreTournee.php new file mode 100644 index 0000000000000000000000000000000000000000..3e17af52e0e9585702a0bfbd9d37b80d2f5d2991 --- /dev/null +++ b/Back_end/src/Entity/OrdreTournee.php @@ -0,0 +1,51 @@ +<?php + +namespace App\Entity; + +use App\Repository\OrdreTourneeRepository; +use Doctrine\ORM\Mapping as ORM; + +#[ORM\Entity(repositoryClass: OrdreTourneeRepository::class)] +class OrdreTournee +{ + #[ORM\Id] + #[ORM\GeneratedValue] + #[ORM\Column] + private ?int $id = null; + + #[ORM\Column] + private ?int $numOrdre = null; + + #[ORM\ManyToOne(inversedBy: 'test')] + #[ORM\JoinColumn(nullable: false)] + private ?Tournee $tournee_id = null; + + public function getId(): ?int + { + return $this->id; + } + + public function getNumOrdre(): ?int + { + return $this->numOrdre; + } + + public function setNumOrdre(int $numOrdre): static + { + $this->numOrdre = $numOrdre; + + return $this; + } + + public function getTourneeId(): ?Tournee + { + return $this->tournee_id; + } + + public function setTourneeId(?Tournee $tournee_id): static + { + $this->tournee_id = $tournee_id; + + return $this; + } +} diff --git a/Back_end/src/Repository/LivraisonRepository.php b/Back_end/src/Repository/LivraisonRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..edd404d8d442a90522b2c40ac822f35a80fc4c7f --- /dev/null +++ b/Back_end/src/Repository/LivraisonRepository.php @@ -0,0 +1,48 @@ +<?php + +namespace App\Repository; + +use App\Entity\Livraison; +use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; +use Doctrine\Persistence\ManagerRegistry; + +/** + * @extends ServiceEntityRepository<Livraison> + * + * @method Livraison|null find($id, $lockMode = null, $lockVersion = null) + * @method Livraison|null findOneBy(array $criteria, array $orderBy = null) + * @method Livraison[] findAll() + * @method Livraison[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class LivraisonRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Livraison::class); + } + +// /** +// * @return Livraison[] Returns an array of Livraison objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('l') +// ->andWhere('l.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('l.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?Livraison +// { +// return $this->createQueryBuilder('l') +// ->andWhere('l.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +} diff --git a/Back_end/src/Repository/OrdreTourneeRepository.php b/Back_end/src/Repository/OrdreTourneeRepository.php new file mode 100644 index 0000000000000000000000000000000000000000..3a546b86b70e56e9588f8bbdffe145018657d362 --- /dev/null +++ b/Back_end/src/Repository/OrdreTourneeRepository.php @@ -0,0 +1,48 @@ +<?php + +namespace App\Repository; + +use App\Entity\OrdreTournee; +use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; +use Doctrine\Persistence\ManagerRegistry; + +/** + * @extends ServiceEntityRepository<OrdreTournee> + * + * @method OrdreTournee|null find($id, $lockMode = null, $lockVersion = null) + * @method OrdreTournee|null findOneBy(array $criteria, array $orderBy = null) + * @method OrdreTournee[] findAll() + * @method OrdreTournee[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + */ +class OrdreTourneeRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, OrdreTournee::class); + } + +// /** +// * @return OrdreTournee[] Returns an array of OrdreTournee objects +// */ +// public function findByExampleField($value): array +// { +// return $this->createQueryBuilder('o') +// ->andWhere('o.exampleField = :val') +// ->setParameter('val', $value) +// ->orderBy('o.id', 'ASC') +// ->setMaxResults(10) +// ->getQuery() +// ->getResult() +// ; +// } + +// public function findOneBySomeField($value): ?OrdreTournee +// { +// return $this->createQueryBuilder('o') +// ->andWhere('o.exampleField = :val') +// ->setParameter('val', $value) +// ->getQuery() +// ->getOneOrNullResult() +// ; +// } +}