开发者

stuck with zend_db_table + join

trying to understand of using Zend_Db_Table.

i have a such table:

then i created classes:

class table_1 extends Zend_Db_Table_Abstract
{
    protected $_name = 'table_1';
    protected $_primary = 't1_id';
    protected $_referenceMap    = array(
        'Dep开发者_Go百科Card' => array(
            'columns'           => 't1_id',
            'refTableClass'     => 'table_2',
            'refColumns'        => 't2_t1'
        ),
        'Select1' => array(
            'columns' => array('t1_select1'),
            'refTableClass' => 'Select_1'
        ),
        'Select2' => array(
            'columns' => array('t1_select2'),
            'refTableClass' => 'Select_2'
        )
    );

}

class table_2 extends Zend_Db_Table_Abstract {
  protected $_dependentTables = array('table_1');
}
class Select_1 extends Zend_Db_Table_Abstract {
  protected $_dependentTables = array('table_1');
}
class Select_2 extends Zend_Db_Table_Abstract{
  protected $_dependentTables = array('table_1');
}

then i want to:

$table_1 = new table_1();
$data = $table_1->fetchAll();

with all dependent tables. is there any way to do this?


Looking at Zend_Db_Table's and Zend_Db_Table_Select's code indicates that this is not possible. It always runs fetchAll on the single table only.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜