2008-05-08 14:17:35 +00:00
|
|
|
<?php
|
2008-07-20 20:13:24 +00:00
|
|
|
class ForumBoard extends Doctrine_Entity
|
|
|
|
{
|
|
|
|
public static function initMetadata($mapping)
|
|
|
|
{
|
2008-07-10 17:17:58 +00:00
|
|
|
/*$metadata->mapField(array(
|
|
|
|
'fieldName' => 'id',
|
|
|
|
'id' => true,
|
|
|
|
'type' => 'integer',
|
|
|
|
'length' => 4
|
|
|
|
));
|
|
|
|
*/
|
2008-07-20 20:13:24 +00:00
|
|
|
$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'
|
|
|
|
));
|
|
|
|
|
|
|
|
$mapping->hasOne('ForumCategory as category',
|
2008-05-08 14:17:35 +00:00
|
|
|
array('local' => 'category_id', 'foreign' => 'id'));
|
2008-07-10 17:17:58 +00:00
|
|
|
/*
|
|
|
|
$metadata->mapOneToOne(array(
|
|
|
|
'fieldName' => 'category', // optional, defaults to targetEntity
|
|
|
|
'targetEntity' => 'ForumCategory',
|
|
|
|
'joinColumns' => array('category_id' => 'id')
|
|
|
|
));
|
|
|
|
*/
|
2008-05-08 14:17:35 +00:00
|
|
|
}
|
|
|
|
}
|