I have an entity called Post in App\EntityPost directory, and i use the doctrine:generate:entities command to generate getter and setter:
$ php bin/console doctrine:generate:entities App/Entity/Post
the error has throw:
[RuntimeException]
Can't find base path for "App\Entity\Post" (path: "/www/src/Entity",
destination: "/www/src/Entity").
i try type command:
$ php bin/console doctrine:generate:entities Post --path=src/Entity
the error has throw:
[RuntimeException]
Namespace "Post" does not contain any mapped entities.
You should create this issue on the SensioGeneratorBundle repo so it can be pushed to Symfony 4.0 & Flex compatibility 馃槃
@eb22fbb4 thanks for reporting this issue, but @Pierstoval is right and we can't fix it in this repository but in the other one related to SensioGeneratorBundle.
Somewhat related to this, we recently removed doctrine:generate:entities from the Symfony Docs. Some "Doctrine experts" told us that this command should no longer be used. Their proposed solution is to not generate getters/setters or let your IDE (e.g. PhpStorm) do that.
What is the alternative to not generating getters/setter if you do not use PHPStorm? NetBeans generation is less than ideal.
@alex-barylski It's still not a subject that belongs to the issues related to Flex. If you want getters and setters, either use your IDE, or just write them manually
There鈥檚 a PR on MakerBundle (104) currently that, when finished, will be able create your getters and setters :).
@weaverryan that's great news :)
@Pierstoval is is a subject because you are taking functionality away that people rely on.
This is a feature that is based on the logic of your application, especially high-level stuff. Flex already has lots of high-level features: configuration files, default stubs, etc.
Adding more is related to components that are only about high-level features, like the MakerBundle which generates code.
As said, code generation for entities is not related to Flex. Either ask Doctrine maintainers, or rely on MakerBundle or old SensioGeneratorBundle. Flex doesn't generate dynamic code for you. Only default config or stubs.
Most helpful comment
@eb22fbb4 thanks for reporting this issue, but @Pierstoval is right and we can't fix it in this repository but in the other one related to SensioGeneratorBundle.
Somewhat related to this, we recently removed
doctrine:generate:entitiesfrom the Symfony Docs. Some "Doctrine experts" told us that this command should no longer be used. Their proposed solution is to not generate getters/setters or let your IDE (e.g. PhpStorm) do that.