Development

#3473: propel-inheritance-patch2.patch

You must first sign up to be able to contribute.

Ticket #3473: propel-inheritance-patch2.patch

File propel-inheritance-patch2.patch, 3.1 kB (added by FabianLange, 8 months ago)

need to apply patch 2 on top of patch 1 refs #3545

  • lib/plugins/sfPropelPlugin/test/unit/fixtures/schema.xml

    old new  
    8383    <column name="culture" isCulture="true" type="varchar" size="7" required="true" primaryKey="true" /> 
    8484  </table> 
    8585 
     86  <table name="history"> 
     87    <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" /> 
     88    <column name="type" type="varchar" size="64" inheritance="single"> 
     89      <inheritance extends="lib.model.History" key="new_user" class="History_NewUser" /> 
     90      <inheritance extends="lib.model.History" key="new_page" class="History_NewPage" /> 
     91    </column> 
     92  </table> 
     93 
    8694</database> 
  • lib/plugins/sfPropelPlugin/test/unit/fixtures/schema.yml

    old new  
    5252   
    5353  ab_group_i18n: 
    5454    motto:            longvarchar 
     55   
     56  history: 
     57    _attributes:    { phpName: History } 
     58    id: 
     59    type:           { type: varchar(64) } 
     60    _inheritance: 
     61      column:       type 
     62      classes: 
     63        new_user:   History_NewUser 
     64        new_page:   History_NewPage 
  • lib/plugins/sfPropelPlugin/test/unit/fixtures/new_schema.yml

    old new  
    6969    tableName:        ab_group_i18n 
    7070    columns: 
    7171      motto:          longvarchar 
     72   
     73  History: 
     74    tableName:      history 
     75    columns: 
     76      id: 
     77      type:         { type: varchar(64) } 
     78    inheritance: 
     79      column:       type 
     80      classes: 
     81        new_user:   History_NewUser 
     82        new_page:   History_NewPage 
  • lib/plugins/sfPropelPlugin/lib/propel/sfPropelDatabaseSchema.class.php

    old new  
    556556        $extended_package = isset($this->database[$tb_name]['_attributes']['package']) ? 
    557557          $this->database[$tb_name]['_attributes']['package'] : 
    558558          $this->database['_attributes']['package']; 
    559         $extended_class = $this->database[$tb_name]['_attributes']['phpName']; 
    560559         
     560        $extended_class = isset($this->database[$tb_name]['_attributes']['phpName']) ? 
     561          $this->database[$tb_name]['_attributes']['phpName'] : 
     562          sfInflector::camelize($tb_name); 
     563         
    561564        foreach ($column['inheritance'] as $key => $class) 
    562565        { 
    563566          $attributes_string .= sprintf('      <inheritance extends="%s.%s" key="%s" class="%s" />%s',