Their are currently several known issues with the OO inheritance right now. It is on our to-do list to fix these things.
- Jon On Dec 12, 2007 4:08 PM, Nate <[EMAIL PROTECTED]> wrote: > > (sorry if double posted, google groups just had a little fit on me...) > > So... Partly a bump, and partly more clues. When inspecting the > generated model, it's got an explicit parent::setTableDefinition() in > the subclass, which Doctrine uses to build concrete inheritance rather > than class-table inheritance. So that's the issue, it's being > generated concrete by sfDoctrine when the docs indicate it should be > CTI. > > The Doctrine source (I can't find it in the docs) shows an option in > the schema called "override_parent" which should force class-table > inheritance if it's set to false - but it doesn't work in sfDoctrine. > > I can see a few places where override_parent is being forced to true > in the doctrine-build-model tasks, but I can't tell why. My quick > hacks aren't able to override it and I'm nervous about changing this > anyway - why is being set to true in so many places? Is there some > reason for that, or just a default behavior that should be accepting > my option in the schema? > > Also, sorry for not doing the research to answer this, but is there a > better place I should be asking about the sfDoctrine plugin? > > Thanks, > Nate > > On Dec 9, 11:20 am, Nate <[EMAIL PROTECTED]> wrote: > > I'm in the beginning stages of setting up an app in Symfony, and I'd > > really like to use OO inheritance in the generated model classes. > > I've got a test schema.yml set up like this: > > > > --- > > AceResource: > > tableName: ace_resource > > columns: > > id: > > type: integer(4) > > primary: true > > autoincrement: true > > institution_id: > > type: integer(4) > > identifier: > > type: string(255) > > title: > > type: string(255) > > Work: > > tableName: work > > inheritance: > > extends: AceResource > > columns: > > display_creator: > > type: string(255) > > > > Basically, Work extends AceResource - and it works, it generates code > > indicating that Work only hasColumn display_creator, and the rest are > > contained in AceResource. My understanding from looking at Doctrine > > documentation (http://www.phpdoctrine.org/index.php/documentation/ > > manual?chapter=relations#inheritance) is that the Work table should > > only contain the unique subclass columns (and an id)... However, I'm > > getting this SQL generated: > > > > CREATE TABLE work (id INT AUTO_INCREMENT, institution_id INT, > > identifier TEXT, title VARCHAR(255), display_creator VARCHAR(255), > > PRIMARY KEY(id)) ENGINE = INNODB; > > CREATE TABLE ace_resource (id INT AUTO_INCREMENT, institution_id INT, > > identifier TEXT, title VARCHAR(255), PRIMARY KEY(id)) ENGINE = INNODB; > > > > ... The Work table contains all of the columns. One of my big reasons > > for trying to get this to work is I want to be able to select various > > subclasses and easily order by columns contained in the AceResource > > superclass. This is totally broken if it's duplicating columns > > between subclasses... > > > > Make sense? I'm currently testing against Symfony 1.0 and sfDoctrine > > 1.0. Is this fixed in the 1.1 version of sfDoctrine? It sounds like > > that's the same except for the tasks, so maybe not? Or will this be a > > bug until the new version of Doctrine is released? Or am I just doing > > something wrong? > > > > Overall I really like how the inheritance is implemented from an > > object perspective, it's exactly what I want, but I would really like > > the DB tables to reflect the documentation... Any clues? > > > > -- Nate > > > -- Jonathan Wage http://www.jwage.com http://www.centresource.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
