From 5c314a7b7d05fccd810b3c5c2a72bf2fab830f8b Mon Sep 17 00:00:00 2001 From: ferishili Date: Tue, 24 Oct 2023 14:38:08 +0200 Subject: [PATCH] fix: findOrGetInstance to apply cache! --- src/Model/Config/PluginConfig.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Config/PluginConfig.php b/src/Model/Config/PluginConfig.php index 2960774be..918389374 100644 --- a/src/Model/Config/PluginConfig.php +++ b/src/Model/Config/PluginConfig.php @@ -263,7 +263,7 @@ public static function importFromXML(string $xml_file_path): void if (!$parent_usage_id) { continue; } - $xoctPublicationSubUsage = new PublicationSubUsage(); + $xoctPublicationSubUsage = PublicationSubUsage::findOrGetInstance(0); $xoctPublicationSubUsage->setParentUsageId($node->getElementsByTagName('parent_usage_id')->item(0)->nodeValue); $xoctPublicationSubUsage->setTitle($node->getElementsByTagName('title')->item(0)->nodeValue); $xoctPublicationSubUsage->setDescription($node->getElementsByTagName('description')->item(0)->nodeValue); @@ -293,7 +293,7 @@ public static function importFromXML(string $xml_file_path): void foreach ($xoct_publication_usage_groups as $node) { $old_id = $node->getElementsByTagName('id')->item(0)->nodeValue; - $xoctPublicationUsageGroup = new PublicationUsageGroup(); + $xoctPublicationUsageGroup = PublicationUsageGroup::findOrGetInstance(0); $xoctPublicationUsageGroup->setName($node->getElementsByTagName('name')->item(0)->nodeValue); $xoctPublicationUsageGroup->setDisplayName($node->getElementsByTagName('display_name')->item(0)->nodeValue); $xoctPublicationUsageGroup->setDescription($node->getElementsByTagName('description')->item(0)->nodeValue);