関数
ComboGroup::updateComboGroup( int $groupId, string $label, bool $optional, bool $enableMultiSelect )
パラメータ パラメータ
- $groupId
(数値) (必須)
- $label
(文字列) (必須)
- $optional
(bool) (必須)
- $enableMultiSelect
(bool) (必須)
ファイル: src/API/ComboGroup.php
public static function updateComboGroup($groupId, $label, $optional, $enableMultiSelect) {
global $wpdb;
$combogroup = self::getComboGroupById($groupId);
if (empty($combogroup)) {
return Master::getErrorStore()->getErrorResponse(
ErrorStore::COMBO_GROUP_NOT_FOUND,
[$groupId],
[],
[$groupId]
);
}
$curtime = Utils::getCurrentUTCDateTimeString();
$csgt = Schema::getComboSetGroupsTable();
$res = $wpdb->update(
$csgt,
[
'group_label' => (string)$label,
'optional' => (int)$optional,
'allow_multiple_selections' => (int)$enableMultiSelect,
'updated_at' => $curtime,
],
['ID' => $groupId],
['%s', '%d', '%d', '%s'],
['%d']
);
if (empty($res)) {
return Master::getErrorStore()->getErrorResponse(ErrorStore::INTERNAL_SERVER_ERROR);
}
return self::getComboGroupById($groupId);
}