On Thu, 27 Jan 2011 17:47:37 -0800 (PST), DisTurBinG <[email protected]>
wrote:
> Hello All,
> 
> I'm new and having a problem with inheritance.
> 
> I have two things I want to solve
> 
> First:
> 
> Input: [b]console doctrine:generate:entities [/b]
> Error: [b]No identifier/primary key specified for Entity 'Bundle
> \RegisterBundle\Entity\Member'. Every Entity must have an identifier/
> primary key.  [/b]
> 
> The Primary key is not being inherited for some reason.  How could I
> use ORM to allow the parent to have a primary key?
> 
> NOTE: [b]I know that the orm works because if I put the ID into both
> Member.php and AbstractMember.php, It works fine and creates the
> tables.[/b]

The Doctrine EntityGenerator is a basic tool. It does not work for
inheritance so you will have to write the getters and setters yourself for
this class.

> 
> Second Problem:
> 
> With Inheritance, why do I need @orm:DiscriminatorColumn(name="discr",
> type="string").
> I want to be inheriting with a SINGLE_TABLE and no references.  Maybe
> the discriminator key needs to be unique id?  Please explain on this
> if any.

The discriminator column is needed to let doctrine know which child class
it has to use when retrieving the object. It is not a unique id as all
entity of the same class will have the same discriminator.

> 
> I've looked all over google and can't find a solution, it seems just
> basic:  * @orm:inheritance(type="simple", extends="AbstractMember")
> with YML configuration works fine from what people say, but it isn't
> here.
> 
> Best Regards, Thanks in Advance and Thanks for the wonderful
> Framework.
> 
> ~DisTurBinG

Regards

-- 
Christophe | Stof

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to