1
0
mirror of synced 2024-12-14 15:16:04 +03:00
doctrine2/tests/models/company/CompanyEmployee.php
2008-12-18 14:08:11 +00:00

41 lines
1.0 KiB
PHP

<?php
class CompanyEmployee
{
#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'
));
}
}
?>