NestTest.php 1008 Bytes
Newer Older
1
<?php
2
class NestTest extends Doctrine_Entity
3
{
4
    public static function initMetadata($class) 
5
    {
6 7
        $class->setColumn('name', 'string');
        $class->hasMany('NestTest as Parents', array('local' => 'child_id',
8 9
                                                    'refClass' => 'NestReference',
                                                    'foreign' => 'parent_id'));
10
        $class->hasMany('NestTest as Children', array('local' => 'parent_id',
11 12 13
                                                     'refClass' => 'NestReference',
                                                     'foreign' => 'child_id'));
                                                     
14
        $class->hasMany('NestTest as Relatives', array('local' => 'child_id',
15 16 17 18 19
                                                      'refClass' => 'NestReference',
                                                      'foreign' => 'parent_id',
                                                      'equal'   => true));
    }
}