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.coaching-en-developpement-personnel.fr
/
htdocs
/
src
/
Services
/
/srv/data/web/vhosts/www.coaching-en-developpement-personnel.fr/htdocs/src/Services/MyService.php
<?php namespace App\Services; use App\Repository\ConfigurationRepository; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\SessionInterface; /** * Class MyServoce */ class MyService { private $session; private $configurationRepository; public function __construct( SessionInterface $session, ConfigurationRepository $configurationRepository ) { $this->session = $session; $this->configurationRepository = $configurationRepository; } // public function getTotal() // { // $carts = $this->getCart(); // $tva = $this->configurationRepository->findOneByName('tva'); // $tva = ( 1 + $tva->getValue()/100); // if (!empty($carts)) { // $total = 0; // foreach ($carts as $cart) { // if ($cart['object']->getSolde() > 0) { // $total += $cart['object']->getPriceSolde() * $cart['qtt']; // } else { // $total += $cart['object']->getPrice() * $cart['qtt']; // } // } // if($this->getDelivery() > 0 ){ // $total = $total + $this->getDelivery(); // } // $total = round($total*$tva, 2); // return $total; // } // return 0; // } // FONCTION GENERATE TOKEN public function getToken($length) { $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } }