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

32 lines
928 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
2008-02-16 19:10:16 +00:00
$class->mapColumn('dtype', 'string', 50);
2008-02-23 22:04:39 +00:00
// column 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-02-16 19:10:16 +00:00
$class->mapColumn('username', 'string', 50);
2008-02-11 17:08:22 +00:00
}
2008-02-23 22:04:39 +00:00
/*
public function getUsername()
{
return $this->rawGet('username') . "!";
}
*/
2008-02-11 17:08:22 +00:00
}