関数
GroupItem::updateGroupItem( int $itemId, float $priceModifier, string $itemLabel, int $itemQuantity )
パラメータ パラメータ
- $itemId
(数値) (必須)
- $priceModifier
(float) (必須)
- $itemLabel
(文字列) (必須)
- $itemQuantity
(数値) (必須)
ファイル: src/API/GroupItem.php
public static function updateGroupItem( $itemId, $priceModifier, $itemLabel, $itemQuantity ) { global $wpdb; $itemId = (int)$itemId; $priceModifier = (float)$priceModifier; $itemQuantity = (int)$itemQuantity; $itemLabel = (string)$itemLabel; $item = self::getGroupItemById($itemId); if ($item === null) { return Master::getErrorStore()->getErrorResponse( ErrorStore::GROUP_ITEM_NOT_FOUND, [$itemId], [], [$itemId] ); } $csgit = Schema::getComboSetGroupItemsTable(); $curtime = Utils::getCurrentUTCDateTimeString(); $res = $wpdb->update( $csgit, [ 'item_label' => $itemLabel, 'item_quantity' => $itemQuantity, 'price_modifier' => $priceModifier, 'updated_at' => $curtime, ], ['ID' => $itemId], ['%s', '%d', '%d', '%s'], ['%d'] ); if (empty($res)) { return Master::getErrorStore()->getErrorResponse(ErrorStore::INTERNAL_SERVER_ERROR); } return self::getGroupItemById($itemId); }