1
0
mirror of synced 2024-12-14 15:16:04 +03:00
doctrine2/tests/Doctrine/Tests/Models/Company/CompanyEmployee.php

41 lines
1.0 KiB
PHP
Raw Normal View History

2008-08-31 22:28:22 +04:00
<?php
class CompanyEmployee
2008-08-31 22:28:22 +04:00
{
#protected $id;
#protected $salary;
#protected $department;
public static function initMetadata($mapping)
{
// inheritance mapping
$mapping->setInheritanceType('joined', array(
'discriminatorColumn' => 'dtype',
'discriminatorMap' => array(
'emp' => 'CompanyEmployee',
'man' => 'CompanyManager')
));
// register subclasses
$mapping->setSubclasses(array('CompanyManager'));
$mapping->mapField(array(
'fieldName' => 'id',
'type' => 'integer',
'length' => 4,
'id' => true,
'idGenerator' => 'auto'
));
$mapping->mapField(array(
'fieldName' => 'salary',
'type' => 'double'
));
//TODO: make department an entity
$mapping->mapField(array(
'fieldName' => 'department',
'type' => 'string'
));
}
}
?>