In my Controller I list all entities I have:
use App\Entity\Members;
use App\Entity\Products;
use App\Entity\Projects;
But because new Entities will automatically be created, I need instead something like
use AllEntities;
Is this possible?
In my Controller I list all entities I have:
use App\Entity\Members;
use App\Entity\Products;
use App\Entity\Projects;
But because new Entities will automatically be created, I need instead something like
use AllEntities;
Is this possible?
There is no available option in PHP to import all classes from particular namespace at once.
In order to use a particular class you need to define so called Fully-qualified class name so it means to use use
keyword for each class OR the other option is to import the namespace but when instantiating or using that class as a static for example you need to use imported namespace followed by \
and the class name.
For example:
use Foo\Bar;
$classOne = new Bar\ClassOne();
$classTwo = new Bar\ClassTwo();
This is valid when there is only one namespace ending with Bar
imported.
Otherwise you need to alias each one - the same applies to repeated class names - they also need to be aliased. This is about the built-in possibilities.
When it comes to your particular case - if you automatically create new entities which means that you generate new code - the only solution I see here is to expand your generation capabilities for generating some new code in places you need it.