Discriminator "fieldName" is not set in ClassMetadata #5763

Closed
opened 2026-01-22 15:17:01 +01:00 by admin · 1 comment
Owner

Originally created by @matthias-z on GitHub (Nov 8, 2017).

Originally assigned to: @Ocramius on GitHub.

When a discriminator column is defined with a field name (property "fieldName") the corresponding value in ClassMetadata is set to the column name (property "name") instead.
It is my understanding that this should only occur as a default when no field name is configured.

I observed this behavior using the AnnotationDriver:

/**
 * @ORM\Entity
 * @ORm\DiscriminatorColumn(fieldName="discriminatorField")
 */

But from what I've seen in the code XmlDriver or YamlDriver should behave the same in that regard.

Originally created by @matthias-z on GitHub (Nov 8, 2017). Originally assigned to: @Ocramius on GitHub. When a discriminator column is defined with a field name (property "fieldName") the corresponding value in ClassMetadata is set to the column name (property "name") instead. It is my understanding that this should only occur as a default when no field name is configured. I observed this behavior using the `AnnotationDriver`: ```php /** * @ORM\Entity * @ORm\DiscriminatorColumn(fieldName="discriminatorField") */ ``` But from what I've seen in the code `XmlDriver` or `YamlDriver` should behave the same in that regard.
admin added the BugInvalid labels 2026-01-22 15:17:01 +01:00
admin closed this issue 2026-01-22 15:17:01 +01:00
Author
Owner

@Ocramius commented on GitHub (Jan 1, 2018):

Closing as invalid as per https://github.com/doctrine/doctrine2/pull/6817#issuecomment-354667371

@Ocramius commented on GitHub (Jan 1, 2018): Closing as `invalid` as per https://github.com/doctrine/doctrine2/pull/6817#issuecomment-354667371
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5763