*/ final class VehicleMapper extends DataMapperFactory { /** * Columns. * * @var array * @since 1.0.0 */ public const COLUMNS = [ 'fleetmgmt_vehicle_id' => ['name' => 'fleetmgmt_vehicle_id', 'type' => 'int', 'internal' => 'id'], 'fleetmgmt_vehicle_name' => ['name' => 'fleetmgmt_vehicle_name', 'type' => 'string', 'internal' => 'name'], 'fleetmgmt_vehicle_status' => ['name' => 'fleetmgmt_vehicle_status', 'type' => 'int', 'internal' => 'status'], 'fleetmgmt_vehicle_info' => ['name' => 'fleetmgmt_vehicle_info', 'type' => 'string', 'internal' => 'info'], 'fleetmgmt_vehicle_unit' => ['name' => 'fleetmgmt_vehicle_unit', 'type' => 'int', 'internal' => 'unit'], 'fleetmgmt_vehicle_responsible' => ['name' => 'fleetmgmt_vehicle_responsible', 'type' => 'int', 'internal' => 'responsible'], 'fleetmgmt_vehicle_created_at' => ['name' => 'fleetmgmt_vehicle_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ public const HAS_MANY = [ 'media' => [ 'mapper' => MediaMapper::class, 'table' => 'fleetmgmt_vehicle_media', 'external' => 'fleetmgmt_vehicle_media_media', 'self' => 'fleetmgmt_vehicle_media_vehicle', ], 'attributes' => [ 'mapper' => VehicleAttributeMapper::class, 'table' => 'fleetmgmt_vehicle_attr', 'self' => 'fleetmgmt_vehicle_attr_item', 'external' => null, ], ]; /** * Has one relation. * * @var array * @since 1.0.0 */ public const OWNS_ONE = [ 'type' => [ 'mapper' => VehicleTypeMapper::class, 'external' => 'fleetmgmt_vehicle_type', ], 'fuelType' => [ 'mapper' => FuelTypeMapper::class, 'external' => 'fleetmgmt_vehicle_fuel', ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ public const TABLE = 'fleetmgmt_vehicle'; /** * Created at. * * @var string * @since 1.0.0 */ public const CREATED_AT = 'fleetmgmt_vehicle_created_at'; /** * Primary field name. * * @var string * @since 1.0.0 */ public const PRIMARYFIELD = 'fleetmgmt_vehicle_id'; }