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

25 lines
866 B
PHP
Raw Normal View History

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