[DDC-2638] [GH-770] Fix for entity generator discriminator column Created: 28/Aug/13  Updated: 07/Sep/13  Resolved: 07/Sep/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.4
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of fulopattila122:

Url: https://github.com/doctrine/doctrine2/pull/770

Message:

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



 Comments   
Comment by Doctrine Bot [ 28/Aug/13 ]

A related Github Pull-Request [GH-770] was closed:
https://github.com/doctrine/doctrine2/pull/770

Generated at Fri Apr 18 00:40:55 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.