From b98d6d2be8bdd396055083b090e128926e75de1d Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Fri, 14 Feb 2025 07:42:29 +0100 Subject: [PATCH] Added loaded trace command --- src/Command/ChargeExampleTraceCommand.php | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/Command/ChargeExampleTraceCommand.php diff --git a/src/Command/ChargeExampleTraceCommand.php b/src/Command/ChargeExampleTraceCommand.php new file mode 100644 index 0000000..f8c9096 --- /dev/null +++ b/src/Command/ChargeExampleTraceCommand.php @@ -0,0 +1,52 @@ +entityManager->getRepository(Client::class)->findAll(); + $traces = TraceStatus::getStatusKeys(); + + var_dump($traces); + + + foreach ($clients as $client) { + foreach ($traces as $traceStatus) { + $trace = new Trace(); + $trace->setClient($client); + $trace->setJobId('CreateAuxiliarFiles_' . $client->getId()); + $trace->setStatus($traceStatus); + $trace->setCommand(CommandTypes::CREATE_IMAGE_AUX_FILE); + $trace->setExecutedAt(new \DateTime()); + $this->entityManager->persist($trace); + } + } + + $this->entityManager->flush(); + + return 1; + } +}