Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
web
/
vhosts
/
www.humitest.fr
/
htdocs
/
src
/
Repository
/
/srv/data/web/vhosts/www.humitest.fr/htdocs/src/Repository/ConfigurationRepository.php
<?php namespace App\Repository; use App\Entity\Configuration; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Symfony\Bridge\Doctrine\RegistryInterface; /** * @method Configuration|null find($id, $lockMode = null, $lockVersion = null) * @method Configuration|null findOneBy(array $criteria, array $orderBy = null) * @method Configuration[] findAll() * @method Configuration[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class ConfigurationRepository extends ServiceEntityRepository { public function __construct(RegistryInterface $registry) { parent::__construct($registry, Configuration::class); } // /** // * @return Configuration[] Returns an array of Configuration objects // */ /* public function findByExampleField($value) { return $this->createQueryBuilder('c') ->andWhere('c.exampleField = :val') ->setParameter('val', $value) ->orderBy('c.id', 'ASC') ->setMaxResults(10) ->getQuery() ->getResult() ; } */ /* public function findOneBySomeField($value): ?Configuration { return $this->createQueryBuilder('c') ->andWhere('c.exampleField = :val') ->setParameter('val', $value) ->getQuery() ->getOneOrNullResult() ; } */ public function zoneExpeditionFR() { return $this->createQueryBuilder('p') ->where("p.zonePoids = 'France'")->getQuery()->getResult(); } public function zoneExpeditionDOM() { return $this->createQueryBuilder('z') ->where("z.zonePoids = 'Dom'")->getQuery()->getResult(); } public function zoneExpeditionEU() { return $this->createQueryBuilder('u') ->where("u.zonePoids = 'Europe'")->getQuery()->getResult(); } public function poidsFrMax() { return $this->createQueryBuilder('e') ->select("MAX(e.valeurPoids)") ->where("e.zonePoids = 'France'") ->getQuery()->getSingleResult(); } public function poidsDomMax() { return $this->createQueryBuilder('f') ->select("MAX(f.valeurPoids)") ->where("f.zonePoids = 'Dom'") ->getQuery()->getSingleResult(); } public function poidsEuropeMax() { return $this->createQueryBuilder('g') ->select("MAX(g.valeurPoids)") ->where("g.zonePoids = 'Europe'") ->getQuery()->getSingleResult(); } public function deliveryByZone($weight, $zone) { $rawSql = "SELECT value FROM `configuration` WHERE zone_poids = $zone and valeur_poids > $weight order by valeur_poids ASC limit 1"; $stmt = $this->getEntityManager()->getConnection()->prepare($rawSql); $stmt->execute(); return $stmt->fetch(); } }