*/ final class EmployeeMapper extends DataMapperFactory { /** * Columns. * * @var array * @since 1.0.0 */ public const COLUMNS = [ 'hr_staff_id' => ['name' => 'hr_staff_id', 'type' => 'int', 'internal' => 'id'], 'hr_staff_profile' => ['name' => 'hr_staff_profile', 'type' => 'int', 'internal' => 'profile'], 'hr_staff_smiPHash' => ['name' => 'hr_staff_smiPHash', 'type' => 'string', 'internal' => 'semiPrivateHash', 'private' => true], 'hr_staff_image' => ['name' => 'hr_staff_image', 'type' => 'int', 'internal' => 'image', 'annotations' => ['gdpr' => true]], ]; /** * Belongs to. * * @var array * @since 1.0.0 */ public const BELONGS_TO = [ 'profile' => [ 'mapper' => ProfileMapper::class, 'external' => 'hr_staff_profile', ], ]; /** * Has one relation. * * @var array * @since 1.0.0 */ public const OWNS_ONE = [ 'image' => [ 'mapper' => MediaMapper::class, 'external' => 'hr_staff_image', ], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ public const HAS_MANY = [ 'files' => [ 'mapper' => MediaMapper::class, /* mapper of the related object */ 'table' => 'hr_staff_media', /* table of the related object, null if no relation table is used (many->1) */ 'external' => 'hr_staff_media_media', 'self' => 'hr_staff_media_item', ], 'companyHistory' => [ 'mapper' => EmployeeHistoryMapper::class, 'table' => 'hr_staff_history', 'self' => 'hr_staff_history_staff', 'external' => null, ], 'workHistory' => [ 'mapper' => EmployeeWorkHistoryMapper::class, 'table' => 'hr_staff_work_history', 'self' => 'hr_staff_work_history_staff', 'external' => null, ], 'educationHistory' => [ 'mapper' => EmployeeEducationHistoryMapper::class, 'table' => 'hr_staff_education_history', 'self' => 'hr_staff_education_history_staff', 'external' => null, ], 'notes' => [ 'mapper' => EditorDocMapper::class, /* mapper of the related object */ 'table' => 'hr_staff_note', /* table of the related object, null if no relation table is used (many->1) */ 'external' => 'hr_staff_note_doc', 'self' => 'hr_staff_note_staff', ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ public const TABLE = 'hr_staff'; /** * Primary field name. * * @var string * @since 1.0.0 */ public const PRIMARYFIELD = 'hr_staff_id'; }