@@ -181,6 +181,7 @@ public function build(): bool
181181 $ attributes = $ metaData ->getAttributes ($ entity );
182182 $ dataTypes = $ metaData ->getDataTypes ($ entity );
183183 $ identityField = $ metaData ->getIdentityField ($ entity );
184+ $ identityField = $ identityField ? $ identityField : null ;
184185 $ primaryKeys = $ metaData ->getPrimaryKeyAttributes ($ entity );
185186
186187 $ setParams = [];
@@ -234,11 +235,11 @@ public function build(): bool
234235 *
235236 * @return string
236237 */
237- private function captureFilterInput (string $ var , $ fields , bool $ useGetSetters , string $ identityField ): string
238+ private function captureFilterInput (string $ var , $ fields , bool $ useGetSetters , string $ identityField = null ): string
238239 {
239240 $ code = '' ;
240241 foreach ($ fields as $ field => $ dataType ) {
241- if ($ field == $ identityField ) {
242+ if ($ identityField !== null && $ field == $ identityField ) {
242243 continue ;
243244 }
244245
@@ -502,28 +503,28 @@ private function makeController(): void
502503 $ code = str_replace ('$assignInputFromRequestCreate$ ' , $ this ->captureFilterInput (
503504 $ this ->options ->get ('singular ' ),
504505 $ this ->options ->get ('dataTypes ' ),
505- $ this ->options ->get ('genSettersGetters ' ),
506+ ( bool ) $ this ->options ->get ('genSettersGetters ' ),
506507 $ this ->options ->get ('identityField ' )
507508 ), $ code );
508509
509510 $ code = str_replace ('$assignInputFromRequestUpdate$ ' , $ this ->captureFilterInput (
510511 $ this ->options ->get ('singular ' ),
511512 $ this ->options ->get ('dataTypes ' ),
512- $ this ->options ->get ('genSettersGetters ' ),
513+ ( bool ) $ this ->options ->get ('genSettersGetters ' ),
513514 $ this ->options ->get ('identityField ' )
514515 ), $ code );
515516
516517 $ code = str_replace ('$assignTagDefaults$ ' , $ this ->assignTagDefaults (
517518 $ this ->options ->get ('singular ' ),
518519 $ this ->options ->get ('dataTypes ' ),
519- $ this ->options ->get ('genSettersGetters ' )
520+ ( bool ) $ this ->options ->get ('genSettersGetters ' )
520521 ), $ code );
521522
522523 $ attributes = $ this ->options ->get ('attributes ' );
523524
524525 $ code = str_replace ('$pkVar$ ' , '$ ' . $ attributes [0 ], $ code );
525526
526- if ($ this ->options ->get ('genSettersGetters ' )) {
527+ if (( bool ) $ this ->options ->get ('genSettersGetters ' )) {
527528 $ code = str_replace ('$pkGet$ ' , 'get ' . Text::camelize ($ attributes [0 ]) . '() ' , $ code );
528529 } else {
529530 $ code = str_replace ('$pkGet$ ' , $ attributes [0 ], $ code );
0 commit comments