関数
ComboSet::getComboSetFromSkuCode( int $post_id, string $sku_code )
GenericError otherwiseパラメータ パラメータ
- $post_id
(数値) (必須) Post ID is required because SKU codes are not unique
- $sku_code
(文字列) (必須) Must be decoded
ファイル: src/API/ComboSet.php
public static function getComboSetFromSkuCode($post_id, $sku_code) {
$sets = self::getAllComboSetsForPostId($post_id);
if (empty($sets)) {
return Master::getErrorStore()->getErrorResponse(
ErrorStore::COMBO_SET_NOT_FOUND_BY_SKU_CODE,
[$post_id, $sku_code]
);
}
foreach ($sets as $set) {
if ($set === null) {
continue;
}
$skudata = $set->getSkuData();
if ($skudata['code'] === $sku_code) {
return $set;
}
}
return Master::getErrorStore()->getErrorResponse(
ErrorStore::COMBO_SET_NOT_FOUND_BY_SKU_CODE,
[$post_id, $sku_code]
);
}