1
0
mirror of synced 2025-01-31 20:41:44 +03:00
doctrine2/tests/models/forum/ForumUser.php
2008-02-11 22:33:12 +00:00

26 lines
840 B
PHP

<?php
class ForumUser extends Doctrine_Record
{
public static function initMetadata($class)
{
// inheritance mapping
$class->setInheritanceType(Doctrine::INHERITANCETYPE_JOINED, array(
'discriminatorColumn' => 'dtype',
'discriminatorMap' => array(
'user' => 'ForumUser',
'admin' => 'ForumAdministrator')
));
$class->setSubclasses(array('ForumAdministrator'));
// the discriminator column
$class->addMappedColumn('dtype', 'string', 50);
// property mapping
$class->addMappedColumn('id', 'integer', 4, array(
'primary' => true,
'autoincrement' => true));
$class->addMappedColumn('username', 'string', 50);
}
}