correct datamapper self/external usage (invert)

This commit is contained in:
Dennis Eichhorn 2020-10-21 22:50:27 +02:00
parent e153df4ee4
commit b076c12280
2 changed files with 7 additions and 7 deletions

View File

@ -54,19 +54,19 @@ final class EmployeeHistoryMapper extends DataMapperAbstract
protected static array $belongsTo = [
'unit' => [
'mapper' => UnitMapper::class,
'self' => 'hr_staff_history_unit',
'external' => 'hr_staff_history_unit',
],
'department' => [
'mapper' => DepartmentMapper::class,
'self' => 'hr_staff_history_department',
'external' => 'hr_staff_history_department',
],
'position' => [
'mapper' => PositionMapper::class,
'self' => 'hr_staff_history_position',
'external' => 'hr_staff_history_position',
],
'employee' => [
'mapper' => EmployeeMapper::class,
'self' => 'hr_staff_history_staff',
'external' => 'hr_staff_history_staff',
],
];

View File

@ -51,7 +51,7 @@ final class EmployeeMapper extends DataMapperAbstract
protected static array $belongsTo = [
'profile' => [
'mapper' => ProfileMapper::class,
'self' => 'hr_staff_profile',
'external' => 'hr_staff_profile',
],
];
@ -65,8 +65,8 @@ final class EmployeeMapper extends DataMapperAbstract
'companyHistory' => [
'mapper' => EmployeeHistoryMapper::class,
'table' => 'hr_staff_history', // @todo: is this requried? This is stored in the mapper already. In other places I'm not using this, either use it everywhere or nowhere. Using the mapper is slower but protects us from table name changes!
'external' => 'hr_staff_history_staff',
'self' => null,
'self' => 'hr_staff_history_staff',
'external' => null,
],
];