[PR #770] [MERGED] Fix for entity generator discriminator column #8685

Open
opened 2026-01-22 16:01:04 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/770
Author: @fulopattila122
Created: 8/28/2013
Status: Merged
Merged: 8/28/2013
Merged by: @guilhermeblanco

Base: masterHead: master


📝 Commits (1)

  • 5669aaf Fix for entity generator discriminator column

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 lib/Doctrine/ORM/Tools/EntityGenerator.php (+1 -1)

📄 Description

I was using the EntityGenerator to create class files from yaml when I realized php warnings like PHP Warning: Illegal string offset 'name' on the console. Warnings have also been emitted for the type and length fields.

The generated php file also contained a wrong annotation for the discriminator column:

 * @ORM\DiscriminatorColumn(name="s", type="s", length=s)

The single change in this pull request resolves the problem, so even the warnings disappear and the generated file contains the proper annotation.

An example yaml:

Subscription:
  type: entity
  table: subscriptions
  id:
    id:
      type: integer
      generator:
        strategy: AUTO
  fields:
    created:
      type: datetime
    updated:
      type: datetime
  inheritanceType: SINGLE_TABLE
  discriminatorColumn:
    name: objectType
    type: string
    length: 255
  discriminatorMap:
  manyToOne:
    user:
      targetEntity: User
      joinColumn:
        name: user_id
        referencedColumnName: id

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/770 **Author:** [@fulopattila122](https://github.com/fulopattila122) **Created:** 8/28/2013 **Status:** ✅ Merged **Merged:** 8/28/2013 **Merged by:** [@guilhermeblanco](https://github.com/guilhermeblanco) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`5669aaf`](https://github.com/doctrine/orm/commit/5669aaf4a315a17e1a4c39900e1145326fd972f4) Fix for entity generator discriminator column ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Tools/EntityGenerator.php` (+1 -1) </details> ### 📄 Description I was using the EntityGenerator to create class files from yaml when I realized php warnings like `PHP Warning: Illegal string offset 'name'` on the console. Warnings have also been emitted for the `type` and `length` fields. The generated php file also contained a wrong annotation for the discriminator column: ``` * @ORM\DiscriminatorColumn(name="s", type="s", length=s) ``` The single change in this pull request resolves the problem, so even the warnings disappear and the generated file contains the proper annotation. An example yaml: ``` Subscription: type: entity table: subscriptions id: id: type: integer generator: strategy: AUTO fields: created: type: datetime updated: type: datetime inheritanceType: SINGLE_TABLE discriminatorColumn: name: objectType type: string length: 255 discriminatorMap: manyToOne: user: targetEntity: User joinColumn: name: user_id referencedColumnName: id ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 16:01:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#8685