From 0c82718c26dba35a3b224df41f6fa1a28203d682 Mon Sep 17 00:00:00 2001 From: Mykola Silin Date: Sat, 15 Feb 2025 19:57:54 +0100 Subject: [PATCH 1/3] 1295 add array as type in DataModel properties --- .../magento2plugin/magento/packages/PropertiesTypes.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/magento/idea/magento2plugin/magento/packages/PropertiesTypes.java b/src/main/java/com/magento/idea/magento2plugin/magento/packages/PropertiesTypes.java index 81c05aa7a..0e43b2dba 100644 --- a/src/main/java/com/magento/idea/magento2plugin/magento/packages/PropertiesTypes.java +++ b/src/main/java/com/magento/idea/magento2plugin/magento/packages/PropertiesTypes.java @@ -14,7 +14,8 @@ public enum PropertiesTypes { INT("int"), FLOAT("float"), STRING("string"), - BOOL("bool"); + BOOL("bool"), + ARRAY("array"); private final String propertyType; @@ -66,7 +67,8 @@ public static String[] getPropertyTypes() { valueOf(INT.toString()).getPropertyType(), valueOf(FLOAT.toString()).getPropertyType(), valueOf(STRING.toString()).getPropertyType(), - valueOf(BOOL.toString()).getPropertyType() + valueOf(BOOL.toString()).getPropertyType(), + valueOf(ARRAY.toString()).getPropertyType() }; } From e7f1cfba21eb9917b1a53a8ba2f33fb60f874d3f Mon Sep 17 00:00:00 2001 From: Mykola Silin Date: Sun, 16 Feb 2025 12:25:10 +0100 Subject: [PATCH 2/3] 1295 fix data model template --- CHANGELOG.md | 1 + .../resources/fileTemplates/internal/Magento Data Model.php.ft | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ae47253b..ef21fe214 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). ### Added - Clear notifications for the process status of URN generation [#2486](https://github.com/magento/magento2-phpstorm-plugin/pull/2486) +- Added array as a type in Data Model properties [#1295](https://github.com/magento/magento2-phpstorm-plugin/pull/1295) ### Fixed diff --git a/src/main/resources/fileTemplates/internal/Magento Data Model.php.ft b/src/main/resources/fileTemplates/internal/Magento Data Model.php.ft index f350c4dc7..a4fa1fdb9 100644 --- a/src/main/resources/fileTemplates/internal/Magento Data Model.php.ft +++ b/src/main/resources/fileTemplates/internal/Magento Data Model.php.ft @@ -48,7 +48,7 @@ class ${NAME} #if (${EXTENDS})extends ${EXTENDS} #end #if (${IMPLEMENTS} && $has */ public function get$propertyUpperCamel(): ?$propertyType { - #if($propertyType == 'string') + #if($propertyType == 'string' || $propertyType == 'array') return $this->getData(self::$propertyUpperSnake); #{else} return $this->getData(self::$propertyUpperSnake) === null ? null From b042d6706eeeb5cb48bc4ab53499996ed5c63f3c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sun, 16 Feb 2025 15:04:34 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef21fe214..866aa47df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). ### Added - Clear notifications for the process status of URN generation [#2486](https://github.com/magento/magento2-phpstorm-plugin/pull/2486) -- Added array as a type in Data Model properties [#1295](https://github.com/magento/magento2-phpstorm-plugin/pull/1295) +- Added array as a type in Data Model properties [#2488](https://github.com/magento/magento2-phpstorm-plugin/pull/2488) ### Fixed