2008-02-11 20:08:22 +03:00
|
|
|
<?php
|
|
|
|
|
2008-02-11 22:56:26 +03:00
|
|
|
class ForumUser extends Doctrine_Record
|
2008-02-11 20:08:22 +03:00
|
|
|
{
|
|
|
|
public static function initMetadata($class)
|
|
|
|
{
|
|
|
|
// inheritance mapping
|
|
|
|
$class->setInheritanceType(Doctrine::INHERITANCETYPE_JOINED, array(
|
|
|
|
'discriminatorColumn' => 'dtype',
|
|
|
|
'discriminatorMap' => array(
|
2008-02-11 22:56:26 +03:00
|
|
|
1 => 'ForumUser',
|
|
|
|
2 => 'ForumAdministrator')
|
2008-02-11 20:08:22 +03:00
|
|
|
));
|
2008-02-11 22:56:26 +03:00
|
|
|
$class->setSubclasses(array('ForumAdministrator'));
|
2008-02-11 20:08:22 +03:00
|
|
|
|
|
|
|
// property mapping
|
|
|
|
$class->addMappedColumn('id', 'integer', 4, array(
|
|
|
|
'primary' => true,
|
|
|
|
'autoincrement' => true));
|
|
|
|
$class->addMappedColumn('username', 'string', 50);
|
|
|
|
}
|
|
|
|
}
|