1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/models/QueryTest_Board.php

28 lines
880 B
PHP

<?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'));
}
/**
* Initializes the relations.
*/
public function setUp()
{
$this->hasOne('QueryTest_Category as category', 'QueryTest_Board.categoryId');
$this->ownsOne('QueryTest_Entry as lastEntry', 'QueryTest_Board.lastEntryId');
}
}