views:

15

answers:

1

In propel 1.3 and 1.4 the following inheritance structure worked fine.

table name="payment_method" baseClass="rwf.lib.SymmetricEncryptedObject"> 
    column name="id" type="INTEGER" required="true" autoIncrement="true" 
primaryKey="true"/> 
    column name="discriminator" type="INTEGER" inheritance="single" 
required="true"> 
      inheritance key="1" class="Card" extends="lib.propel.PaymentMethod"/> 
      inheritance key="2" class="RecurringPaymentMethod" 
extends="lib.propel.PaymentMethod"/> 
      inheritance key="4" class="DirectDebit" 
extend="lib.propel.RecurringPaymentMethod"/> 
      inheritance key="5" class="Cheque" 
extends="lib.propel.PaymentMethod"/> 
      inheritance key="6" class="PayPal" 
extends="lib.propel.PaymentMethod"/> 
      inheritance key="7" class="Moto" extends="lib.propel.PaymentMethod"/> 
    /column> 

However with propel 1.5 when you create a new inheritance say

inheritance key="8" class="RepeatingPayPal" extends="lib.propel.PaymentMethod"/> 

I get the following error

[PHP Error] Argument 1 passed to DataModelBuilder::getNewStubObjectBuilder() 
must be an instance of Table, null given, called in /usr/local/www/ 
/extlib/propel-1.5.2/generator/lib/builder/om/PH P5MultiExtendObjectBuilder.phpon 
line 119 and defined [line 432 of /usr/local/www/ 
/extlib/propel-1.5.2/generator/lib/builder/DataM odelBuilder.php] 
[PHP Error] Argument 1 passed to GeneratorConfig::getConfiguredBuilder() 
must be an instance of Table, null given, called in /usr/local/www/ 
/extlib/propel-1.5.2/generator/lib/builder/DataM odelBuilder.phpon 
line 434 and defined [line 180 of /usr/local/www/ 
d/extlib/propel-1.5.2/generator/lib/config/Genera torConfig.php] 
[PHP Error] Argument 1 passed to ObjectBuilder::__construct() must be an 
instance of Table, null given, called in /usr/local/www/ 
/extlib/propel-1.5.2/generator/lib/config/Genera torConfig.phpon 
line 183 and defined [line 30 of /usr/local/www/ 
/extlib/propel-1.5.2/generator/lib/builder/om/Ob jectBuilder.php] 
[PHP Error] Argument 1 passed to DataModelBuilder::__construct() must be an 
instance of Table, null given, called in /usr/local/www/ 
/extlib/propel-1.5.2/generator/lib/builder/om/Ob jectBuilder.phpon 
line 31 and defined [line 160 of /usr/local/www/ 
/extlib/propel-1.5.2/generator/lib/builder/DataM odelBuilder.php] 

Now to almost solve this I can remove the lib.propel from the extends section. but I still get the same error when I create an inheritance that references an inheritance class ie.

inheritance key="3" class="ContinuousAuthorityCard" 
extends="lib.propel.RecurringPaymentMethod"/> 

(with or without lib.propel)

im not sure if this is a bug or a configuration problem but I cannot find any docs that deal with the situation. I think I need to be able to state lib.propel as we have classes in here that we use and also classes with in another directory called rwf.lib as you can see from the baseClass of the table pasted above.

Hope someone can point me in the right direction.

A: 

So I decided I no longer needed the lib.propel which has got ride of the first problem.

There was second problem I came across with inheritance and this is the bug I have posted http://www.propelorm.org/ticket/1033 if anyone is interested in that.

Alistair Prestidge