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

26 lines
840 B
PHP
Raw Normal View History

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