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

Add Entities

parent c50bd01f
Branches
No related tags found
No related merge requests found
<?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;
}
}
<?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;
}
}
<?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()
// ;
// }
}
<?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()
// ;
// }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment