QueryTest_Board.php 876 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php
class QueryTest_Board extends Doctrine_Record
{
    /**
     * Initializes the table definition.
     */
    public function setTableDefinition()
    {        
        $this->hasColumn('categoryId as categoryId', 'integer', 4,
                array('notnull'));
        $this->hasColumn('name as name', 'string', 100,
                array('notnull', 'unique'));
        $this->hasColumn('lastEntryId as lastEntryId', 'integer', 4,
                array('default' => 0, 'notnull'));
        $this->hasColumn('position as position', 'integer', 4,
                array('default' => 0, 'notnull'));
    }
18

19 20 21 22 23 24 25 26 27
    /**
     * Initializes the relations.
     */
    public function setUp()
    {
        $this->hasOne('QueryTest_Category as category', 'QueryTest_Board.categoryId');
        $this->ownsOne('QueryTest_Entry as lastEntry', 'QueryTest_Board.lastEntryId');
    }
}