QueryTest_Board.php 856 Bytes
Newer Older
1
<?php
2
class QueryTest_Board extends Doctrine_Entity
3 4 5 6
{
    /**
     * Initializes the table definition.
     */
7
    public static function initMetadata($class)
8
    {        
9
        $class->setColumn('categoryId as categoryId', 'integer', 4,
10
                array('notnull'));
11
        $class->setColumn('name as name', 'string', 100,
12
                array('notnull', 'unique'));
13
        $class->setColumn('lastEntryId as lastEntryId', 'integer', 4,
14
                array('default' => 0, 'notnull'));
15
        $class->setColumn('position as position', 'integer', 4,
16
                array('default' => 0, 'notnull'));
17 18 19
                
        $class->hasOne('QueryTest_Category as category', array('local' => 'categoryId', 'foreign' => 'id'));
        $class->hasOne('QueryTest_Entry as lastEntry', array('local' => 'lastEntryId', 'foreign' => 'id'));
20 21
    }
}