2

の使用を理解しようとしていZend_Db_Tableます。

私はそのようなテーブルを持っています:

次に、クラスを作成しました:

class table_1 extends Zend_Db_Table_Abstract
{
    protected $_name = 'table_1';
    protected $_primary = 't1_id';
    protected $_referenceMap    = array(
        'DepCard' => 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');
}

それから私はしたい:

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

すべての従属テーブルで。これを行う方法はありますか?

4

1 に答える 1