*/ final class SalesRepMapper extends DataMapperFactory { /** * Columns. * * @var array * @since 1.0.0 */ public const COLUMNS = [ 'sales_rep_id' => ['name' => 'sales_rep_id', 'type' => 'int', 'internal' => 'id'], 'sales_rep_code' => ['name' => 'sales_rep_code', 'type' => 'string', 'internal' => 'code'], 'sales_rep_main' => ['name' => 'sales_rep_main', 'type' => 'int', 'internal' => 'main'], ]; /** * Primary table. * * @var string * @since 1.0.0 */ public const TABLE = 'sales_rep'; /** * Primary field name. * * @var string * @since 1.0.0 */ public const PRIMARYFIELD = 'sales_rep_id'; /** * Has one relation. * * @var array * @since 1.0.0 */ public const OWNS_ONE = [ 'main' => [ 'mapper' => AccountMapper::class, 'external' => 'sales_rep_main', ], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ public const HAS_MANY = [ 'files' => [ 'mapper' => MediaMapper::class, /* mapper of the related object */ 'table' => 'sales_rep_media', /* table of the related object, null if no relation table is used (many->1) */ 'external' => 'sales_rep_media_dst', 'self' => 'sales_rep_media_src', ], ]; }