diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ae47253b..866aa47df 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 [#2488](https://github.com/magento/magento2-phpstorm-plugin/pull/2488) ### Fixed 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() }; } 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