QueryTest_User.php 567 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
<?php
class QueryTest_User extends Doctrine_Record 
{   

    public function setTableDefinition()
    {        
        $this->hasColumn('username as username', 'string', 50,
                array('notnull'));
        $this->hasColumn('visibleRankId', 'integer', 4);
    }
11

12 13 14 15 16 17 18 19 20
    /**
     * Runtime definition of the relationships to other entities.
     */
    public function setUp()
    {
        $this->hasOne('QueryTest_Rank as visibleRank', 'QueryTest_User.visibleRankId');
        $this->hasMany('QueryTest_Rank as ranks', 'QueryTest_UserRank.rankId');
    }
}