propelorm/Propel — Issue #159: [Single inheritance] absctract : wrong generation of buildTableMap in class Peer
Author: jaugustin
Created: 2011-10-24 12:05:34+00:00
State: open

Hi,

There is an issue with the emulateForeignKeyConstraints and the single table inheritance when the table is abstract.

it generate a Exception when it cascade delete. I track this and find that it come from this generated method:

```php
hasTable(BaseComponentPeer::TABLE_NAME))
{
$dbMap->addTableObject(new TableMap());
}
}
```

if I fixed it like that, it work :

```php
hasTable(BaseComponentPeer::TABLE_NAME))
{
$dbMap->addTableObject(new ComponentTableMap());
}
}
```

I don't know which part should be fixed:

the addBuildTableMap method :
https://github.com/propelorm/Propel/blob/master/generator/lib/builder/om/PHP5PeerBuilder.php#L515

or the addDoOnDeleteCascade / addDoOnDeleteSetNull
https://github.com/propelorm/Propel/blob/master/generator/lib/builder/om/PHP5PeerBuilder.php#L1650