Your software
My Mautic version is: 6.x
My PHP version is: 8.3.6
My Database type and version is: mysql 8.0.41
Your problem
My problem is: I don’t understand why make:entity does not use the namespace of the class name provided when creating an entity class.
These errors are showing in the log: No, Mautic does not see it as an error. It just does it.
Steps I have tried to fix the problem:
Here is what I did at the command line:
$ bin/console make:entity
Class name of the entity to create or update (e.g. OrangePopsicle):
> MauticPlugin\MauticSocialBundle\Entity\Test2
created: app/bundles/Entity/MauticPlugin/MauticSocialBundle/Entity/Test2.php
created: app/bundles/Repository/MauticPlugin/MauticSocialBundle/Entity/Test2Repository.php
The namespace of Test2
is Mautic\Entity\MauticPlugin\MauticSocialBundle\Entity;
not
MauticPlugin\MauticSocialBundle\Entity
as in the input.
However, if I give an existing class, then it uses the given namespace and modify the existing class without moving it. For example:
Class name of the entity to create or update (e.g. DeliciousKangaroo):
> MauticPlugin\MauticSocialBundle\Entity\Test
Your entity already exists! So let's add some new fields!
Then the existing class in plugins/MauticSocialBundle/Entity/Test.php
is modified.
I searched in the documentation, but found no explanations. Is it the expected behaviour ?