ProductsMappingRepository
in package
Table of Contents
- $connection : Connection
- __construct() : mixed
- addMapping() : void
- Adds a mapping to the repository.
- findMappingByAfterbuyProduct() : ProductMapping
- findMappingByProductsId() : ProductMapping
- removeMappingsForProduct() : int
- isValidProduct() : bool
Properties
$connection
private
Connection
$connection
Methods
__construct()
public
__construct(Connection $connection) : mixed
Parameters
- $connection : Connection
Return values
mixed —addMapping()
Adds a mapping to the repository.
public
addMapping(ProductMapping $mapping[, string $dataOrigin = 'unknown' ]) : void
$dataOrigin may be 'unknown', 'shop' (product originally created in shop, exported to Afterbuy) or 'afterbuy' (product originally created in Afterbuy, imported into shop)
Parameters
- $mapping : ProductMapping
- $dataOrigin : string = 'unknown'
Tags
Return values
void —findMappingByAfterbuyProduct()
public
findMappingByAfterbuyProduct(AfterbuyProduct $afterbuyProduct) : ProductMapping
Parameters
- $afterbuyProduct : AfterbuyProduct
Tags
Return values
ProductMapping —findMappingByProductsId()
public
findMappingByProductsId(int $productsId, int|null $combiId) : ProductMapping
Parameters
- $productsId : int
- $combiId : int|null
Tags
Return values
ProductMapping —removeMappingsForProduct()
public
removeMappingsForProduct(int $productsId) : int
Parameters
- $productsId : int
Return values
int —isValidProduct()
private
isValidProduct(int $productsId) : bool
Parameters
- $productsId : int