【发布时间】:2011-09-10 21:16:54
【问题描述】:
我知道网络上有一些示例,但不适用于我的情况。
我有一个包含子类别的类别表。一个表“类别”,其 id_father 是父类别的 id。 我的配置如下:
Application_Model_DbTable_Category:
protected $_referenceMap = array(
'Application_Model_DbTable_Category' => array(
'columns' => 'id_father',
'refColumns' => 'id',
'refTableClass' => 'Application_Model_DbTable_Category'
));
CategoryMapper(我不写最上面的代码,反正我检索到一个在 db 中有父类的 Category)
$row = $result->current();
echo $row->name;
$father = 'Non trovato';
$father = $row->findParentRow('Application_Model_DbTable_Category');
print_r($father);
这不会打印任何东西...我的代码有问题吗?谢谢你
【问题讨论】: