From 4456ab7b334dd0b181b90c9a4e775ff4f727aa93 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Mon, 27 May 2024 08:01:36 +0200 Subject: [PATCH] fix definition interpreter --- .gitignore | 4 +++- .../Interpreter/DefinitionInterpreter.php | 2 +- src/DataDefinitionsBundle/Model/ExportDefinition.php | 2 +- src/DataDefinitionsBundle/Model/ImportDefinition.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 62faa52b..4a0facd3 100644 --- a/.gitignore +++ b/.gitignore @@ -69,4 +69,6 @@ web public docker-compose.yaml test-commands.txt -.docker \ No newline at end of file +.docker +cache +config/pimcore/data-definitions \ No newline at end of file diff --git a/src/DataDefinitionsBundle/Interpreter/DefinitionInterpreter.php b/src/DataDefinitionsBundle/Interpreter/DefinitionInterpreter.php index a5b54d08..8fc02a2c 100644 --- a/src/DataDefinitionsBundle/Interpreter/DefinitionInterpreter.php +++ b/src/DataDefinitionsBundle/Interpreter/DefinitionInterpreter.php @@ -34,7 +34,7 @@ public function __construct(RepositoryInterface $definitionRepository, ImporterI } public function interpret(InterpreterContextInterface $context): mixed { - $subDefinition = $this->definitionRepository->find((string)($context->getConfiguration()['definition'])); + $subDefinition = $this->definitionRepository->find($context->getConfiguration()['definition']); if (!$subDefinition instanceof ImportDefinitionInterface) { return null; diff --git a/src/DataDefinitionsBundle/Model/ExportDefinition.php b/src/DataDefinitionsBundle/Model/ExportDefinition.php index fe5a0b7d..557a4760 100644 --- a/src/DataDefinitionsBundle/Model/ExportDefinition.php +++ b/src/DataDefinitionsBundle/Model/ExportDefinition.php @@ -36,7 +36,7 @@ class ExportDefinition extends AbstractDataDefinition implements ExportDefinitio */ public $fetchUnpublished = false; - public static function getById(string $name) + public static function getById(int $name) { return static::getByName($name); } diff --git a/src/DataDefinitionsBundle/Model/ImportDefinition.php b/src/DataDefinitionsBundle/Model/ImportDefinition.php index d696ee70..79bfa2f0 100644 --- a/src/DataDefinitionsBundle/Model/ImportDefinition.php +++ b/src/DataDefinitionsBundle/Model/ImportDefinition.php @@ -86,7 +86,7 @@ class ImportDefinition extends AbstractDataDefinition implements ImportDefinitio */ public $persister; - public static function getById(string $name) + public static function getById(int $name) { return static::getByName($name); }