diff --git a/Models/DepartmentMapper.php b/Models/DepartmentMapper.php index 0790d87..2f6ca5c 100644 --- a/Models/DepartmentMapper.php +++ b/Models/DepartmentMapper.php @@ -34,6 +34,13 @@ class DepartmentMapper extends DataMapperAbstract 'organization_department_unit' => ['name' => 'organization_department_unit', 'type' => 'int', 'internal' => 'unit'], ]; + protected static $belongsTo = [ + 'account' => [ + 'mapper' => UnitMapper::class, + 'dest' => 'organization_department_unit', + ], + ]; + /** * Primary table. * diff --git a/Models/PositionMapper.php b/Models/PositionMapper.php index 9b441c3..989a391 100644 --- a/Models/PositionMapper.php +++ b/Models/PositionMapper.php @@ -34,6 +34,13 @@ class PositionMapper extends DataMapperAbstract 'organization_position_status' => ['name' => 'organization_position_status', 'type' => 'int', 'internal' => 'status'], ]; + protected static $belongsTo = [ + 'account' => [ + 'mapper' => PositionMapper::class, + 'dest' => 'organization_position_parent', + ], + ]; + /** * Primary table. * diff --git a/Models/UnitMapper.php b/Models/UnitMapper.php index df38f35..485b408 100644 --- a/Models/UnitMapper.php +++ b/Models/UnitMapper.php @@ -33,6 +33,13 @@ class UnitMapper extends DataMapperAbstract 'organization_unit_status' => ['name' => 'organization_unit_status', 'type' => 'int', 'internal' => 'status'], ]; + protected static $belongsTo = [ + 'account' => [ + 'mapper' => UnitMapper::class, + 'dest' => 'organization_uni_parent', + ], + ]; + /** * Primary table. *