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

27 lines
866 B
PHP
Raw Normal View History

2008-02-11 17:08:22 +00:00
<?php
class ForumUser extends Doctrine_Entity
2008-02-11 17:08:22 +00:00
{
public static function initMetadata($class)
{
// inheritance mapping
2008-03-23 11:30:29 +00:00
$class->setInheritanceType(Doctrine::INHERITANCE_TYPE_JOINED, array(
2008-02-11 17:08:22 +00:00
'discriminatorColumn' => 'dtype',
'discriminatorMap' => array(
'user' => 'ForumUser',
'admin' => 'ForumAdministrator')
2008-02-11 17:08:22 +00:00
));
2008-03-23 11:30:29 +00:00
// register subclasses
2008-02-11 19:56:26 +00:00
$class->setSubclasses(array('ForumAdministrator'));
// the discriminator column
2008-02-16 19:10:16 +00:00
$class->mapColumn('dtype', 'string', 50);
2008-03-23 11:30:29 +00:00
// column-to-field mapping
2008-02-16 19:10:16 +00:00
$class->mapColumn('id', 'integer', 4, array(
2008-02-11 17:08:22 +00:00
'primary' => true,
'autoincrement' => true));
2008-05-25 20:57:56 +00:00
$class->mapColumn('username', 'string', 50, array());
2008-02-11 17:08:22 +00:00
}
2008-02-11 17:08:22 +00:00
}