Skip to content
Snippets Groups Projects
Commit 228d6c49 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Retrait des routes consoles

parent ab3a2a0a
Branches
Tags 1.2.3
No related merge requests found
Pipeline #33485 failed
Showing
with 475 additions and 152 deletions
......@@ -2,16 +2,22 @@
namespace UnicaenIndicateur;
use Laminas\Config\Config;
use Laminas\Config\Factory as ConfigFactory;
use Laminas\Mvc\ModuleRouteListener;
use Laminas\Mvc\MvcEvent;
use Laminas\Stdlib\ArrayUtils;
use Laminas\Stdlib\Glob;
use Unicaen\Console\Console;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class Module
{
public function onBootstrap(MvcEvent $e)
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function onBootstrap(MvcEvent $e): void
{
$e->getApplication()->getServiceManager()->get('translator');
$eventManager = $e->getApplication()->getEventManager();
......@@ -20,7 +26,7 @@ class Module
}
public function getConfig()
public function getConfig(): array|Config
{
$configInit = [
__DIR__ . '/config/module.config.php'
......@@ -34,23 +40,15 @@ class Module
}
public function getAutoloaderConfig()
public function getAutoloaderConfig(): array
{
return array(
'Laminas\Loader\StandardAutoloader' => array(
'namespaces' => array(
return [
'Laminas\Loader\StandardAutoloader' => [
'namespaces' => [
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
],
],
];
}
// public function getConsoleUsage(Console $console)
// {
// return [
// 'indicateur-refresh' => "Rafraichir la liste des indicateurs",
//
// 'indicateur-notifier' => "Notifier les personnes abonnées à des indicateurs avec les données du dernier rafraichissement",
// ];
// }
}
......@@ -8,11 +8,11 @@
}
],
"require": {
"unicaen/app": "^4|^5|^6",
"unicaen/utilisateur": "^4|^5|^6",
"unicaen/privilege": "^4|^5|^6",
"unicaen/mail": "^5|^6|^7",
"unicaen/console": "^6"
"laminas/laminas-cli": "*",
"unicaen/app": ">=6.2",
"unicaen/utilisateur": ">=6.2",
"unicaen/privilege": ">=6.2",
"unicaen/mail": ">7"
},
"autoload": {
"psr-0": [],
......
<?php
use Unicaen\Console\Router\Simple;
use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;
use UnicaenIndicateur\Controller\AbonnementController;
use UnicaenIndicateur\Controller\AbonnementControllerFactory;
use UnicaenIndicateur\Provider\Privilege\AbonnementPrivileges;
......@@ -8,9 +9,6 @@ use UnicaenIndicateur\Service\Abonnement\AbonnementService;
use UnicaenIndicateur\Service\Abonnement\AbonnementServiceFactory;
use UnicaenPrivilege\Guard\PrivilegeController;
use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;
return [
'bjyauthorize' => [
'guards' => [
......@@ -54,7 +52,7 @@ return [
'options' => [
'route' => '/souscrire/:indicateur',
'defaults' => [
'controller' => AbonnementController::class,
/** @see AbonnementController::souscrireAction() */
'action' => 'souscrire'
],
],
......@@ -65,7 +63,7 @@ return [
'options' => [
'route' => '/resilier/:indicateur',
'defaults' => [
'controller' => AbonnementController::class,
/** @see AbonnementController::resilierAction() */
'action' => 'resilier'
],
],
......@@ -76,7 +74,7 @@ return [
'options' => [
'route' => '/notifier',
'defaults' => [
'controller' => AbonnementController::class,
/** @see AbonnementController::notifierAction() */
'action' => 'notifier'
],
],
......@@ -87,22 +85,6 @@ return [
],
],
'console' => [
'router' => [
'routes' => [
'indicateur-notifier' => [
'type' => Simple::class,
'options' => [
'route' => 'indicateur-notifier',
'defaults' => [
'controller' => AbonnementController::class,
'action' => 'notifier-console'
],
],
],
],
],
],
'service_manager' => [
'factories' => [
AbonnementService::class => AbonnementServiceFactory::class,
......
<?php
use UnicaenIndicateur\Command\NotifyIndicateurCommand;
use UnicaenIndicateur\Command\NotifyIndicateurCommandFactory;
use UnicaenIndicateur\Command\NotifyIndicateursCommand;
use UnicaenIndicateur\Command\NotifyIndicateursCommandFactory;
use UnicaenIndicateur\Command\RefreshIndicateurCommand;
use UnicaenIndicateur\Command\RefreshIndicateurCommandFactory;
use UnicaenIndicateur\Command\RefreshIndicateursCommand;
use UnicaenIndicateur\Command\RefreshIndicateursCommandFactory;
return [
'bjyauthorize' => [
'guards' => [
],
],
'laminas-cli' => [
'commands' => [
'notify-indicateur' => NotifyIndicateurCommand::class,
'notify-indicateurs' => NotifyIndicateursCommand::class,
'refresh-indicateur' => RefreshIndicateurCommand::class,
'refresh-indicateurs' => RefreshIndicateursCommand::class,
],
],
'controllers' => [
'factories' => [
],
],
'service_manager' => [
'factories' => [
NotifyIndicateurCommand::class => NotifyIndicateurCommandFactory::class,
NotifyIndicateursCommand::class => NotifyIndicateursCommandFactory::class,
RefreshIndicateurCommand::class => RefreshIndicateurCommandFactory::class,
RefreshIndicateursCommand::class => RefreshIndicateursCommandFactory::class,
],
],
'form_elements' => [
'factories' => [
],
],
'hydrators' => [
'factories' => [
],
],
'view_helpers' => [
'invokables' => [
],
],
];
<?php
use UnicaenIndicateur\Controller\IndicateurConsoleController;
use UnicaenIndicateur\Controller\IndicateurConsoleControllerFactory;
use UnicaenIndicateur\Controller\IndicateurController;
use UnicaenIndicateur\Controller\IndicateurControllerFactory;
use UnicaenIndicateur\Form\Indicateur\IndicateurForm;
......@@ -14,7 +12,6 @@ use UnicaenIndicateur\Service\Indicateur\IndicateurServiceFactory;
use UnicaenIndicateur\View\Helper\DefaultItemViewHelper;
use UnicaenIndicateur\View\Helper\IndicateurViewHelperFactory;
use UnicaenPrivilege\Guard\PrivilegeController;
use Unicaen\Console\Router\Simple;
use Laminas\Router\Http\Literal;
use Laminas\Router\Http\Segment;
......@@ -62,15 +59,7 @@ return [
IndicateurPrivileges::DETRUIRE_INDICATEUR,
],
],
[
'controller' => IndicateurConsoleController::class,
'action' => [
'rafraichir-console',
],
'roles' => [],
],
],
],
],
......@@ -81,6 +70,7 @@ return [
'options' => [
'route' => '/indicateurs',
'defaults' => [
/** @see IndicateurController::indexAction() */
'controller' => IndicateurController::class,
'action' => 'index',
],
......@@ -91,6 +81,10 @@ return [
'type' => Literal::class,
'options' => [
'route' => '/indicateur',
'defaults' => [
/** @see IndicateurController::indexAction() */
'controller' => IndicateurController::class,
],
],
'may_terminate' => false,
'child_routes' => [
......@@ -99,7 +93,7 @@ return [
'options' => [
'route' => '/afficher/:indicateur',
'defaults' => [
'controller' => IndicateurController::class,
/** @see IndicateurController::afficherAction() */
'action' => 'afficher',
],
],
......@@ -110,7 +104,7 @@ return [
'options' => [
'route' => '/rafraichir/:indicateur',
'defaults' => [
'controller' => IndicateurController::class,
/** @see IndicateurController::rafraichirAction() */
'action' => 'rafraichir',
],
],
......@@ -121,7 +115,7 @@ return [
'options' => [
'route' => '/regenerer/:indicateur',
'defaults' => [
'controller' => IndicateurController::class,
/** @see IndicateurController::regenererAction() */
'action' => 'regenerer',
],
],
......@@ -132,7 +126,7 @@ return [
'options' => [
'route' => '/creer',
'defaults' => [
'controller' => IndicateurController::class,
/** @see IndicateurController::creerAction() */
'action' => 'creer',
],
],
......@@ -143,7 +137,7 @@ return [
'options' => [
'route' => '/modifier/:indicateur',
'defaults' => [
'controller' => IndicateurController::class,
/** @see IndicateurController::modifierAction() */
'action' => 'modifier',
],
],
......@@ -154,7 +148,7 @@ return [
'options' => [
'route' => '/detruire/:indicateur',
'defaults' => [
'controller' => IndicateurController::class,
/** @see IndicateurController::detruireAction() */
'action' => 'detruire',
],
],
......@@ -165,7 +159,7 @@ return [
'options' => [
'route' => '/exporter/:indicateur',
'defaults' => [
'controller' => IndicateurController::class,
/** @see IndicateurController::exporterAction() */
'action' => 'exporter',
],
],
......@@ -176,23 +170,6 @@ return [
],
],
'console' => [
'router' => [
'routes' => [
'indicateur-refresh' => [
'type' => Simple::class,
'options' => [
'route' => 'indicateur-refresh',
'defaults' => [
'controller' => IndicateurConsoleController::class,
'action' => 'rafraichir-console'
],
],
],
],
],
],
'service_manager' => [
'factories' => [
IndicateurService::class => IndicateurServiceFactory::class,
......@@ -201,7 +178,6 @@ return [
'controllers' => [
'factories' => [
IndicateurController::class => IndicateurControllerFactory::class,
IndicateurConsoleController::class => IndicateurConsoleControllerFactory::class,
],
],
'form_elements' => [
......
<?php
namespace UnicaenIndicateur\Command;
use DateTime;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnicaenIndicateur\Service\Abonnement\AbonnementServiceAwareTrait;
use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
use UnicaenMail\Service\Mail\MailServiceAwareTrait;
class NotifyIndicateurCommand extends Command
{
use AbonnementServiceAwareTrait;
use IndicateurServiceAwareTrait;
use MailServiceAwareTrait;
protected static $defaultName = 'notify-indicateur';
protected function configure(): void
{
$this->setDescription("Notification d'un indicateur aux abonné·es");
$this->addArgument('code', InputArgument::REQUIRED, "Code de l'indicateur");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$code = $input->getArgument('code');
$io->title("Notification de l'indicateur [" . $code . "] aux abonné·es");
$indicateur = $this->getIndicateurService()->getIndicateurByCode($code);
if ($indicateur === null) {
$io->error("Aucun indicateur pour ce code [" . $code . "]");
return self::FAILURE;
}
$abonnements = $indicateur->getAbonnements();
$io->text(count($abonnements) . " abonnements");
$titre = "Publication de l'indicateur [" . $indicateur->getTitre() . "] (" . (new DateTime())->format("d/m/Y à H:i:s") . ")";
$result = $this->getIndicateurService()->getIndicateurData($indicateur);
$texte = "<table>";
$texte .= "<thead>";
$texte .= "<tr>";
foreach ($result[0] as $rubrique) $texte .= "<th>" . $rubrique . "</th>";
$texte .= "</tr>";
$texte .= "</thead>";
$texte .= "<tbody>";
foreach ($result[1] as $item) {
$texte .= "<tr>";
foreach ($item as $value) $texte .= "<td>" . $value . "</td>";
$texte .= "</tr>";
}
$texte .= "</tbody>";
$texte .= "</table>";
foreach ($abonnements as $abonnement) {
$adresse = $abonnement->getUser()->getEmail();
$mail = $this->getMailService()->sendMail($adresse, $titre, $texte);
$mail->setMotsClefs([$indicateur->generateTag()]);
$this->getMailService()->update($mail);
$abonnement->setDernierEnvoi(new DateTime());
$this->getAbonnementService()->update($abonnement);
}
$io->success("Notifications des abonnements de l'indicateur [" . $code . "] effectuées");
return self::SUCCESS;
}
}
\ No newline at end of file
<?php
namespace UnicaenIndicateur\Command;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\Console\Command\Command;
use UnicaenIndicateur\Service\Abonnement\AbonnementService;
use UnicaenIndicateur\Service\Indicateur\IndicateurService;
use UnicaenMail\Service\Mail\MailService;
class NotifyIndicateurCommandFactory extends Command
{
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container): NotifyIndicateurCommand
{
/**
* @see AbonnementService $abonnementService
* @see IndicateurService $indicateurService
* @see MailService $mailService
*/
$abonnementService = $container->get(AbonnementService::class);
$indcateurService = $container->get(IndicateurService::class);
$mailService = $container->get(MailService::class);
$command = new NotifyIndicateurCommand();
$command->setAbonnementService($abonnementService);
$command->setIndicateurService($indcateurService);
$command->setMailService($mailService);
return $command;
}
}
<?php
namespace UnicaenIndicateur\Command;
use DateTime;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnicaenIndicateur\Service\Abonnement\AbonnementServiceAwareTrait;
use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
use UnicaenMail\Service\Mail\MailServiceAwareTrait;
class NotifyIndicateursCommand extends Command
{
use AbonnementServiceAwareTrait;
use IndicateurServiceAwareTrait;
use MailServiceAwareTrait;
protected static $defaultName = 'notify-indicateurs';
protected function configure(): void
{
$this->setDescription("Notification des indicateurs aux abonné·es");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$io->title("Notification des indicateurs aux abonné·es");
$indicateurs = $this->getIndicateurService()->getIndicateurs();
$nbIndicateurs = count($indicateurs);
$io->text($nbIndicateurs . " indicateurs à notifier");
$position = 1;
foreach ($indicateurs as $indicateur) {
$io->text($position ."/". $nbIndicateurs. " : indicateur [".$indicateur->getCode()."]");
$abonnements = $indicateur->getAbonnements();
$io->text($position ."/". $nbIndicateurs. " : ".count($abonnements)." abonnements pour cet indicateur" );
$titre = "Publication de l'indicateur [".$indicateur->getTitre()."] (". (new DateTime())->format("d/m/Y à H:i:s").")";
$result = $this->getIndicateurService()->getIndicateurData($indicateur);
$texte = "<table>";
$texte .= "<thead>";
$texte .= "<tr>";
foreach ($result[0] as $rubrique) $texte .= "<th>" . $rubrique . "</th>";
$texte .= "</tr>";
$texte .= "</thead>";
$texte .= "<tbody>";
foreach ($result[1] as $item) {
$texte .="<tr>";
foreach ($item as $value) $texte .="<td>". $value ."</td>";
$texte .="</tr>";
}
$texte .= "</tbody>";
$texte .= "</table>";
foreach ($abonnements as $abonnement) {
$adresse = $abonnement->getUser()->getEmail();
$mail = $this->getMailService()->sendMail($adresse, $titre, $texte);
$mail->setMotsClefs([$indicateur->generateTag()]);
$this->getMailService()->update($mail);
$abonnement->setDernierEnvoi(new DateTime());
$this->getAbonnementService()->update($abonnement);
}
$position++;
}
$io->success("Notifications des abonnements des indicateurs effectuées");
return self::SUCCESS;
}
}
\ No newline at end of file
<?php
namespace UnicaenIndicateur\Command;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\Console\Command\Command;
use UnicaenIndicateur\Service\Abonnement\AbonnementService;
use UnicaenIndicateur\Service\Indicateur\IndicateurService;
use UnicaenMail\Service\Mail\MailService;
class NotifyIndicateursCommandFactory extends Command
{
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container): NotifyIndicateursCommand
{
/**
* @see AbonnementService $abonnementService
* @see IndicateurService $indicateurService
* @see MailService $mailService
*/
$abonnementService = $container->get(AbonnementService::class);
$indcateurService = $container->get(IndicateurService::class);
$mailService = $container->get(MailService::class);
$command = new NotifyIndicateursCommand();
$command->setAbonnementService($abonnementService);
$command->setIndicateurService($indcateurService);
$command->setMailService($mailService);
return $command;
}
}
<?php
namespace UnicaenIndicateur\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
class RefreshIndicateurCommand extends Command
{
use IndicateurServiceAwareTrait;
protected static $defaultName = 'refresh-indicateur';
protected function configure(): void
{
$this->setDescription("Rafraichissement d'un indicateur (dont le code est passé en argument)");
$this->addArgument('code', InputArgument::REQUIRED, "Code de l'indicateur");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$code = $input->getArgument('code');
$io->title("Rafraichissement de l'indicateur [" . $code . "]");
$indicateur = $this->getIndicateurService()->getIndicateurByCode($code);
if ($indicateur === null) {
$io->error("Aucun indicateur pour ce code [" . $code . "]");
return self::FAILURE;
}
$this->getIndicateurService()->refresh($indicateur);
$io->success("Rafraichissements de l'indicateur effectué");
return self::SUCCESS;
}
}
\ No newline at end of file
<?php
namespace UnicaenIndicateur\Command;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\Console\Command\Command;
use UnicaenIndicateur\Service\Indicateur\IndicateurService;
class RefreshIndicateurCommandFactory extends Command
{
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container): RefreshIndicateurCommand
{
/**
* @see IndicateurService $indicateurService
*/
$indcateurService = $container->get(IndicateurService::class);
$command = new RefreshIndicateurCommand();
$command->setIndicateurService($indcateurService);
return $command;
}
}
<?php
namespace UnicaenIndicateur\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
class RefreshIndicateursCommand extends Command
{
use IndicateurServiceAwareTrait;
protected static $defaultName = 'refresh-indicateurs';
protected function configure(): void
{
$this->setDescription("Rafraichissement des indicateurs");
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$io->title("Rafraichissement des indicateurs");
$indicateurs = $this->getIndicateurService()->getIndicateurs();
$nbIndicateurs = count($indicateurs);
$io->text($nbIndicateurs . " indicateurs à rafraichir");
$position = 1;
foreach ($indicateurs as $indicateur) {
$io->text($position . "/" . $nbIndicateurs . " : indicateur [" . $indicateur->getCode() . "]");
$this->getIndicateurService()->refresh($indicateur);
$position++;
}
$io->success("Rafraichissements des indicateurs effectués");
return self::SUCCESS;
}
}
\ No newline at end of file
<?php
namespace UnicaenIndicateur\Command;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\Console\Command\Command;
use UnicaenIndicateur\Service\Indicateur\IndicateurService;
class RefreshIndicateursCommandFactory extends Command
{
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container): RefreshIndicateursCommand
{
/**
* @see IndicateurService $indicateurService
*/
$indcateurService = $container->get(IndicateurService::class);
$command = new RefreshIndicateursCommand();
$command->setIndicateurService($indcateurService);
return $command;
}
}
......@@ -3,12 +3,12 @@
namespace UnicaenIndicateur\Controller;
use Laminas\Http\Response;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;
use UnicaenIndicateur\Entity\Db\Abonnement;
use UnicaenIndicateur\Service\Abonnement\AbonnementServiceAwareTrait;
use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
use UnicaenUtilisateur\Service\User\UserServiceAwareTrait;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;
class AbonnementController extends AbstractActionController {
use AbonnementServiceAwareTrait;
......@@ -57,8 +57,4 @@ class AbonnementController extends AbstractActionController {
return $this->redirect()->toRoute('indicateurs', [], [], true);
}
public function notifierConsoleAction() : void
{
$this->getAbonnementService()->notifyAbonnements();
}
}
\ No newline at end of file
......@@ -2,14 +2,17 @@
namespace UnicaenIndicateur\Controller;
use Interop\Container\ContainerInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use UnicaenIndicateur\Service\Abonnement\AbonnementService;
use UnicaenIndicateur\Service\Indicateur\IndicateurService;
use Interop\Container\ContainerInterface;
use UnicaenUtilisateur\Service\User\UserService;;
use UnicaenUtilisateur\Service\User\UserService;
class AbonnementControllerFactory {
;
class AbonnementControllerFactory
{
/**
* @param ContainerInterface $container
......
<?php
namespace UnicaenIndicateur\Controller;
use Unicaen\Console\Controller\AbstractConsoleController;
use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
class IndicateurConsoleController extends AbstractConsoleController
{
use IndicateurServiceAwareTrait;
public function rafraichirConsoleAction(): void
{
$indicateurs = $this->getIndicateurService()->getIndicateurs();
foreach ($indicateurs as $indicateur) {
$this->getIndicateurService()->refresh($indicateur);
}
}
}
\ No newline at end of file
<?php
namespace UnicaenIndicateur\Controller;
use Psr\Container\ContainerInterface;
use Unicaen\Console\Controller\AbstractConsoleController;
use UnicaenIndicateur\Service\Indicateur\IndicateurService;
use UnicaenIndicateur\Service\Indicateur\IndicateurServiceAwareTrait;
class IndicateurConsoleControllerFactory
{
public function __invoke(ContainerInterface $container): IndicateurConsoleController
{
/**
* @var IndicateurService $indicateurService
*/
$indicateurService = $container->get(IndicateurService::class);
$controller = new IndicateurConsoleController();
$controller->setIndicateurService($indicateurService);
return $controller;
}
}
\ No newline at end of file
......@@ -222,11 +222,4 @@ class IndicateurController extends AbstractActionController {
}
}
public function rafraichirConsoleAction() : void
{
$indicateurs = $this->getIndicateurService()->getIndicateurs();
foreach ($indicateurs as $indicateur) {
$this->getIndicateurService()->refresh($indicateur);
}
}
}
\ No newline at end of file
......@@ -230,7 +230,7 @@ class IndicateurService
return $this->getIndicateur($id);
}
public function getIndicateurByCode(string $code): ?Indicateur
public function getIndicateurByCode(string $code)//: ?Indicateur
{
$qb = $this->createQueryBuilder()
->andWhere('indicateur.code = :code')->setParameter('code', $code);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment