6

I'm reading through the Doctrine documentation but I can't find a way to implement the type of inheritance I want to use.

I would like to set up a hierarchy like so:

Node -> Something -> Something Else

With Node being the main parent.

I would like to store data common to everything in a node table, eg date of creation, update etc rather than storing this same information in every table. The child classes would then have varying properties depending on their purposes.

Doctrine's simple and column_aggregation methods do not appear to be able to create new tables for the child classes, whilst the concrete method makes a new table but copies all of the parent's properties.

Is there a way to achieve this?

Any advice appreciated.

Thanks.

2
  • Do you mean your trying to create something hierarchical. Commented Jul 6, 2011 at 12:41
  • Ignore me, I know what you mean now. You would need to implement that yourself I believe as it would require look ups to multiple tables. Commented Jul 6, 2011 at 12:44

1 Answer 1

1

Doctrine 2.x supports class table inheritance, which is what you want here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.