2008年11月21日星期五

Re: [fw-db] Zend DB -> tables relations

On Fri, Nov 21, 2008 at 1:45 PM, Carlos Castro
<carloscastro.carlos@gmail.com> wrote:
> Hi another time,
> I'm sorry about insistence, but i can't understand why we need to create
> things like :
> 'Reporter' => array(
>
> 'columns' => 'reported_by',
> 'refTableClass' => 'Accounts',
> 'refColumns' => 'account_name '
> ), here.
>
> Here is my example:
> class News extends Zend_Db_Table_Abstract
> {
> protected $_name = 'news';
> protected $_primary = 'ID';
> }
> class CatNews extends Zend_Db_Table_Abstract
> {
> protected $_name = 'catnews';
> protected $_primary = 'ID';
> protected $_dependentTables = array('news');
> }
> How can i represent here, my foreign keys? This is the only things that i
> need?
> Thanks in advance!

The manual should cover this topic:
http://framework.zend.com/manual/en/zend.db.table.relationships.html

Till

没有评论: