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(
149149 protected void fillAttributes (final @ NotNull Properties attributes ) {
150150 final PhpClassTypesBuilder phpClassTypesBuilder = new PhpClassTypesBuilder ();
151151
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+
152160 phpClassTypesBuilder
153161 .appendProperty ("NAME" , data .getFormName ())
154162 .appendProperty ("LABEL" , data .getLabel ())
@@ -165,7 +173,6 @@ protected void fillAttributes(final @NotNull Properties attributes) {
165173 data .getDataProviderPath ()
166174 ).getClassFqn ()
167175 )
168- .appendProperty ("PRIMARY_FIELD" , data .getFields ().get (0 ).getName ())
169176 .mergeProperties (attributes );
170177 }
171178
You can’t perform that action at this time.
0 commit comments