File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/com/magento/idea/magento2plugin/actions/generation/generator Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,14 @@ protected PsiFile createForm(
149
149
protected void fillAttributes (final @ NotNull Properties attributes ) {
150
150
final PhpClassTypesBuilder phpClassTypesBuilder = new PhpClassTypesBuilder ();
151
151
152
+ if (data .getFields ().isEmpty ()) {
153
+ phpClassTypesBuilder
154
+ .appendProperty ("PRIMARY_FIELD" , "" );
155
+ } else {
156
+ phpClassTypesBuilder
157
+ .appendProperty ("PRIMARY_FIELD" , data .getFields ().get (0 ).getName ());
158
+ }
159
+
152
160
phpClassTypesBuilder
153
161
.appendProperty ("NAME" , data .getFormName ())
154
162
.appendProperty ("LABEL" , data .getLabel ())
@@ -165,7 +173,6 @@ protected void fillAttributes(final @NotNull Properties attributes) {
165
173
data .getDataProviderPath ()
166
174
).getClassFqn ()
167
175
)
168
- .appendProperty ("PRIMARY_FIELD" , data .getFields ().get (0 ).getName ())
169
176
.mergeProperties (attributes );
170
177
}
171
178
You can’t perform that action at this time.
0 commit comments