1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/tests/models/forum/ForumBoard.php

38 lines
1.0 KiB
PHP
Raw Normal View History

2008-05-08 18:17:35 +04:00
<?php
class ForumBoard extends Doctrine_Entity
{
public static function initMetadata($mapping)
{
/*$metadata->mapField(array(
'fieldName' => 'id',
'id' => true,
'type' => 'integer',
'length' => 4
));
*/
$mapping->mapField(array(
'fieldName' => 'id',
'type' => 'integer',
'length' => 4,
'id' => true
));
$mapping->mapField(array(
'fieldName' => 'position',
'type' => 'integer'
));
$mapping->mapField(array(
'fieldName' => 'category_id',
'type' => 'integer'
));
2008-08-16 23:40:59 +04:00
/*$mapping->hasOne('ForumCategory as category',
array('local' => 'category_id', 'foreign' => 'id'));*/
$mapping->mapOneToOne(array(
'fieldName' => 'category',
'targetEntity' => 'ForumCategory',
'joinColumns' => array('category_id' => 'id')
2008-08-16 23:40:59 +04:00
));
2008-05-08 18:17:35 +04:00
}
}