non- FQCN in discriminatorMap?

im working on a symfony/doctrine/Api-platform project and would like to add a @ORMDiscriminatorMap to my class, and would like to reference a class that is not in the namespace.

The documentation only says:

The names of the classes in the discriminator map do not need to be
fully qualified if the classes are contained in the same namespace as
the entity class on which the discriminator map is applied.

https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/inheritance-mapping.html

Is there a way to add a class to the discriminatorMap without using the fqcn when its not in the same namespace? Or is there a way to add the classes to the namespace through a command?

I’ve unsuccessfully tried:

use [...]ClassIwant
/**
 * @ORMDiscriminatorMap({
"classIwant" : "classIwant::class"`
 * })
 */

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *