0

Hello all
Is Zend_Db_Table( Zend_Db_Table_*) 支持通过/where定义的相关数据$_referenceMap$_dependentTable

例如,我有博客(表:博客)和区域(表:区域)类,每个博客都有 region_id:

|-------------|              |--------------|
| regions     |              | blogs        |
|-------------| 1     :    m |--------------|
| region_id   | <----------- | region_id    |
| region_name |              | blog_id      |
|-------------|              | blog_message |
                             | blog_enabled |
                             |--------------|

有什么办法吗,比如:

$a = new Regions();
$a->fetchRow(1)->findBlogs(..., $a->getAdapter()->quoteInto('blog_enabled = ?', 1));

即找到Regionregion_id == 1然后找到所有Blogs属于Region和拥有的blog_enabled == 1

4

1 回答 1

0

找到了解决方案:

$a = new News();
$a->fetchRow()->findParentRegions($a->select()->where('region_enabled = ?', 1));
于 2011-01-15T11:44:24.343 回答