Zend Framework Source Code Snippets

Defining Relationships

Bookmark and Share
1
2
3
4
56
7
8
9
1011
12
13
14
1516
17
18
class BugsProducts extends Zend_Db_Table_Abstract
{
    protected $_name = 'bugs_products';
 
    protected $_referenceMap    = array(        'Bug' => array(
            'columns'           => array('bug_id'),
            'refTableClass'     => 'Bugs',
            'refColumns'        => array('bug_id')
        ),        'Product' => array(
            'columns'           => array('product_id'),
            'refTableClass'     => 'Products',
            'refColumns'        => array('product_id')
        )    );
 
}

Comments

You must login before commenting on a snippet. If you do not have an account, please register.

Snippet description

Below are the PHP class definitions for these tables:

Snippet details

Created:
ouss_sk8 ouss_sk8
2 months ago
Edited:
ouss_sk8 ouss_sk8
2 months ago
Revision Id:
225
Edit Message:
Initial Release
ZF Version
1.10.7
Tags:
Zend_Db_Table
Comments:
0
Views:
521
Points:
0 (0 votes)

History

r225

Initial Release

ouss_sk8 ouss_sk8
2 months ago