maker-bundle icon indicating copy to clipboard operation
maker-bundle copied to clipboard

[make:entity] Error when linking a relation property with FQCN using command.

Open fd6130 opened this issue 4 years ago • 1 comments

Normally we are using App\Entity namespace and folder in Symfony and the maker command can easily detect that.

But when i'm using a subfolder such as App\Entity\Product, it lose the auto detect/auto complete from the command (i think it is fine? Not sure though). And it is broken when i try to link a relation property using FQCN.

Example, linking a OneToOne relation using FQCN will lead to error:

Compile Error: Cannot declare class App\Entity\Product\Product, because the name is already in use

fd6130 avatar Sep 30 '21 10:09 fd6130

I confirm, make:entity does not work when:

  • we use as field type: 'relation', 'OneToOne', 'ManyToOne' (I did not test others)
  • AND entities are in subpackages (ex: src/Entity/Package1/Entity1.php being related with src/Entity/Package2/Entity2.php)

I did reproduce it on a fresh 6.3 symfony install, with maker 1.49 and php 8.2

tmarly avatar Jul 18 '23 13:07 tmarly