继承问题与推动1.5.2

时间:2010-07-02 09:16:35

标签: inheritance schema propel single-table-inheritance

在推进1.3和1.4中,以下继承结构工作正常。

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> 

然而,当你创建一个新的继承时,使用propel 1.5说

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

我收到以下错误

[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] 

现在几乎要解决这个问题,我可以从extends中删除lib.propel 部分。但是当我创建一个继承时,我仍然会遇到同样的错误 引用继承类即。

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

(有或没有lib.propel)

我不确定这是一个错误还是一个配置问题,但我找不到 任何处理这种情况的文件。我想我需要能够陈述 lib.propel因为我们在这里使用了类,而且还有使用in的类 另一个名为rwf.lib的目录,你可以从baseClass中看到 桌子贴在上面。

希望有人能指出我正确的方向。

1 个答案:

答案 0 :(得分:0)

所以我决定不再需要第一个问题的lib.propel了。

我遇到了继承的第二个问题,如果有人对此感兴趣,这就是我发布的http://www.propelorm.org/ticket/1033错误。