models
下的节点应该与app\code\community\Dhl\Intraship\etc\config.xml
同一个:
<?xml version="1.0"?>
<config>
<modules>
<Dhl_Intraship>
<version>13.07.04</version>
</Dhl_Intraship>
</modules>
<!-- some more code here -->
<global>
<models>
<intraship> <!-- this is the node you have to look at -->
<class>Dhl_Intraship_Model</class>
<resourceModel>intraship_mysql4</resourceModel>
</intraship>
<!-- some more code here -->
</models>
<!-- some more code here -->
<global>
</config>
而且rewrite
下的节点已经以适应所要的文件夹模式下的改写文件的路径:所以在你区分它只是gateway
。但如果你是重写app\code\community\Dhl\Intraship\Model\Path\To\Some\Model.php
节点会一直path_to_some_model
所以它应该看起来像这样:
<?xml version="1.0"?>
<config>
<modules>
<mycompany_intraship>
<version>0.1.0</version>
</mycompany_intraship >
</modules>
<global>
<models>
<intraship>
<rewrite>
<gateway>MyCompany_Intraship_Model_Gateway</gateway>
</rewrite>
</intraship>
</models>
</global>
</config>
感谢@ b.enoit.be - 这正是我一直在寻找的解释和帮助我尝试了几个小时后。 – Torben