From 2876f490f8f453b13257142c09b82e6bfe9d9671 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 28 Sep 2016 22:07:54 +0200 Subject: [PATCH] Preparing for query extension implementing media for task/task elements and preparing for unit parent display. --- Models/DepartmentMapper.php | 7 +++++++ Models/PositionMapper.php | 7 +++++++ Models/UnitMapper.php | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/Models/DepartmentMapper.php b/Models/DepartmentMapper.php index 25bd3d0..a3522b4 100644 --- a/Models/DepartmentMapper.php +++ b/Models/DepartmentMapper.php @@ -33,6 +33,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 df6ee5a..b67ea58 100644 --- a/Models/PositionMapper.php +++ b/Models/PositionMapper.php @@ -33,6 +33,13 @@ class PositionMapper extends DataMapperAbstract 'organization_position_parent' => ['name' => 'organization_position_parent', 'type' => 'int', 'internal' => 'parent'], ]; + protected static $belongsTo = [ + 'account' => [ + 'mapper' => PositionMapper::class, + 'dest' => 'organization_position_parent', + ], + ]; + /** * Primary table. * diff --git a/Models/UnitMapper.php b/Models/UnitMapper.php index f7148c7..23f4245 100644 --- a/Models/UnitMapper.php +++ b/Models/UnitMapper.php @@ -32,6 +32,13 @@ class UnitMapper extends DataMapperAbstract 'organization_unit_parent' => ['name' => 'organization_unit_parent', 'type' => 'int', 'internal' => 'parent'], ]; + protected static $belongsTo = [ + 'account' => [ + 'mapper' => UnitMapper::class, + 'dest' => 'organization_uni_parent', + ], + ]; + /** * Primary table. *