@@ -92,7 +92,7 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
9292 'This command will generate any missing methods (e.g. getters & setters) for a class or all classes in a namespace. ' ,
9393 'To overwrite any existing methods, re-run this command with the --overwrite flag ' ,
9494 ], null , 'fg=yellow ' );
95- $ classOrNamespace = $ io ->ask ('Enter a class or namespace to regenerate ' , $ this ->entityNamespace , [Validator::class, 'notBlank ' ]);
95+ $ classOrNamespace = $ io ->ask ('Enter a class or namespace to regenerate ' , $ this ->getEntityNamespace () , [Validator::class, 'notBlank ' ]);
9696
9797 $ input ->setArgument ('name ' , $ classOrNamespace );
9898
@@ -518,14 +518,14 @@ private function askRelationDetails(ConsoleStyle $io, string $generatedEntityCla
518518 $ targetEntityClass = $ io ->askQuestion ($ question );
519519
520520 if (!class_exists ($ targetEntityClass )) {
521- if (!class_exists ($ this ->entityNamespace .'\\' .$ targetEntityClass )) {
521+ if (!class_exists ($ this ->getEntityNamespace () .'\\' .$ targetEntityClass )) {
522522 $ io ->error (sprintf ('Unknown class "%s" ' , $ targetEntityClass ));
523523 $ targetEntityClass = null ;
524524
525525 continue ;
526526 }
527527
528- $ targetEntityClass = $ this ->entityNamespace .'\\' .$ targetEntityClass ;
528+ $ targetEntityClass = $ this ->getEntityNamespace () .'\\' .$ targetEntityClass ;
529529 }
530530 }
531531
@@ -841,4 +841,9 @@ private function doesEntityUseAnnotationMapping(string $className): bool
841841
842842 return $ driver instanceof AnnotationDriver;
843843 }
844+
845+ private function getEntityNamespace (): string
846+ {
847+ return $ this ->doctrineHelper ->getEntityNamespace ();
848+ }
844849}
0 commit comments