diff --git a/Command/InstallCommand.php b/Command/InstallCommand.php index 3e5a9eb3..97b13a28 100644 --- a/Command/InstallCommand.php +++ b/Command/InstallCommand.php @@ -37,12 +37,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int { $this->installationService->setStyle(new SymfonyStyle($input, $output)); - $bundle = $input->getArgument('bundle'); - $data = $input->getArgument('data'); - $noSchema = $input->getOption('schema'); - $script = $input->getOption('script'); - $unsafe = $input->getOption('unsafe'); - - return $this->installationService->install($bundle, $noSchema); + return $this->installationService->install($input->getArgument('bundle'), [ + 'data' => $input->getArgument('data'), + 'noSchema' => $input->getOption('schema'), + 'script' => $input->getOption('script'), + 'unsafe' => $input->getOption('unsafe'), + ]); } } diff --git a/Service/InstallationService.php b/Service/InstallationService.php index e7fc9bfb..581063e1 100644 --- a/Service/InstallationService.php +++ b/Service/InstallationService.php @@ -548,6 +548,7 @@ private function saveOnFixedId(ObjectEntity $objectEntity, array $hydrate = []): $objectEntity->setId($id); $this->em->persist($objectEntity); $this->em->flush(); + $this->em->clear(get_class($objectEntity)); $objectEntity = $this->em->getRepository('App:ObjectEntity')->findOneBy(['id' => $id]); $this->io->writeln(['Defintive object id ('.$objectEntity->getId().')']); diff --git a/Service/RequestService.php b/Service/RequestService.php index faee996d..a8a75105 100644 --- a/Service/RequestService.php +++ b/Service/RequestService.php @@ -443,7 +443,7 @@ public function requestHandler(array $data, array $configuration): Response $responseLog = new Response(is_string($this->content) || is_null($this->content) ? $this->content : null, 200, ['CoreBundle' => 'GetItem']); $session = new Session(); $session->set('object', $this->id); - + // todo: This log is needed so we know an user has 'read' this object $this->logService->saveLog($this->logService->makeRequest(), $responseLog, 15, is_array($this->content) ? json_encode($this->content) : $this->content); } else {