Skip to content

Commit 10d6165

Browse files
authored
Merge pull request #2488 from SilinMykola/1295-add-array-to-datamodel-properties
1295 add array as type in DataModel properties
2 parents a71ee13 + b042d67 commit 10d6165

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
99
### Added
1010

1111
- Clear notifications for the process status of URN generation [#2486](https://github.com/magento/magento2-phpstorm-plugin/pull/2486)
12+
- Added array as a type in Data Model properties [#2488](https://github.com/magento/magento2-phpstorm-plugin/pull/2488)
1213

1314
### Fixed
1415

src/main/java/com/magento/idea/magento2plugin/magento/packages/PropertiesTypes.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public enum PropertiesTypes {
1414
INT("int"),
1515
FLOAT("float"),
1616
STRING("string"),
17-
BOOL("bool");
17+
BOOL("bool"),
18+
ARRAY("array");
1819

1920
private final String propertyType;
2021

@@ -66,7 +67,8 @@ public static String[] getPropertyTypes() {
6667
valueOf(INT.toString()).getPropertyType(),
6768
valueOf(FLOAT.toString()).getPropertyType(),
6869
valueOf(STRING.toString()).getPropertyType(),
69-
valueOf(BOOL.toString()).getPropertyType()
70+
valueOf(BOOL.toString()).getPropertyType(),
71+
valueOf(ARRAY.toString()).getPropertyType()
7072
};
7173
}
7274

src/main/resources/fileTemplates/internal/Magento Data Model.php.ft

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ${NAME} #if (${EXTENDS})extends ${EXTENDS} #end #if (${IMPLEMENTS} && $has
4848
*/
4949
public function get$propertyUpperCamel(): ?$propertyType
5050
{
51-
#if($propertyType == 'string')
51+
#if($propertyType == 'string' || $propertyType == 'array')
5252
return $this->getData(self::$propertyUpperSnake);
5353
#{else}
5454
return $this->getData(self::$propertyUpperSnake) === null ? null

0 commit comments

Comments
 (0)