2008年11月20日星期四

[fw-db] Foreign Keys in ZF

Hi everybody,
I need some help to understand the tables relations on ZF.
Through Programmers Reference Guide, i can see next example:

class Bugs extends Zend_Db_Table_Abstract
{
    protected $_name            = 'bugs';

    protected $_dependentTables = array('BugsProducts');

    protected $_referenceMap    = array(
        'Reporter' => array(
            'columns'           => 'reported_by',
            'refTableClass'     => 'Accounts',
            'refColumns'        => 'account_name'
        ),

My question is about $_referenceMap.  To represent the foreign keys of my DB, i need to specify rules (like, in this case, Reporter)? On DB, to create Foreign Keys, i don't need inserting some kind of data into tables.

Thanks by helping me!


没有评论: