1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/tests/models/forum/ForumUser.php
2008-05-25 20:57:56 +00:00

27 lines
866 B
PHP

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