*/ final class StockTakingMapper extends DataMapperFactory { /** * Columns. * * @var array * @since 1.0.0 */ public const COLUMNS = [ 'stocktaking_id' => ['name' => 'stocktaking_id', 'type' => 'int', 'internal' => 'id'], 'stocktaking_unit' => ['name' => 'stocktaking_unit', 'type' => 'int', 'internal' => 'unit'], 'stocktaking_created_at' => ['name' => 'stocktaking_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ public const HAS_MANY = [ 'distributions' => [ 'mapper' => StockDistributionMapper::class, 'table' => 'stocktaking_distribution', 'self' => 'stocktaking_distribution_stocktaking', 'external' => 'stocktaking_distribution_distribution', ], 'stocks' => [ 'mapper' => StockMapper::class, 'table' => 'stocktaking_stock', 'self' => 'stocktaking_stock_stocktaking', 'external' => 'stocktaking_stock_stock', ], 'types' => [ 'mapper' => StockTypeMapper::class, 'table' => 'stocktaking_type', 'self' => 'stocktaking_type_stocktaking', 'external' => 'stocktaking_type_type', ], 'items' => [ 'mapper' => ItemMapper::class, 'table' => 'stocktaking_item', 'self' => 'stocktaking_item_stocktaking', 'external' => 'stocktaking_item_item', ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ public const TABLE = 'stocktaking'; /** * Primary field name. * * @var string * @since 1.0.0 */ public const PRIMARYFIELD = 'stocktaking_id'; }