本文整理匯總了PHP中ca_sets::removeItemFromAllSets方法的典型用法代碼示例。如果您正苦於以下問題:PHP ca_sets::removeItemFromAllSets方法的具體用法?PHP ca_sets::removeItemFromAllSets怎麽用?PHP ca_sets::removeItemFromAllSets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ca_sets
的用法示例。
在下文中一共展示了ca_sets::removeItemFromAllSets方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: saveBundlesForScreen
//.........這裏部分代碼省略.........
}
$this->update();
break;
# -------------------------------------
// This bundle is only available for types which support set membership
# -------------------------------------
// This bundle is only available for types which support set membership
case 'ca_sets':
// check for existing labels to delete (no updating supported)
require_once __CA_MODELS_DIR__ . '/ca_sets.php';
require_once __CA_MODELS_DIR__ . '/ca_set_items.php';
$t_set = new ca_sets();
if (!$vb_batch) {
$va_sets = caExtractValuesByUserLocale($t_set->getSetsForItem($this->tableNum(), $this->getPrimaryKey(), array('user_id' => $po_request->getUserID())));
foreach ($va_sets as $vn_set_id => $va_set_info) {
$vn_item_id = $va_set_info['item_id'];
if ($po_request->getParameter("{$vs_placement_code}{$vs_form_prefix}_set_id_{$vn_item_id}_delete", pString)) {
// delete
$t_set->load($va_set_info['set_id']);
$t_set->removeItem($this->getPrimaryKey(), $po_request->getUserID());
// remove *all* instances of the item in the set, not just the specified id
if ($t_set->numErrors()) {
$po_request->addActionErrors($t_set->errors(), $vs_f);
}
}
}
}
if ($vb_batch) {
$vs_batch_mode = $_REQUEST["{$vs_placement_code}{$vs_form_prefix}_batch_mode"];
if ($vs_batch_mode == '_disabled_') {
break;
}
if ($vs_batch_mode == '_replace_') {
$t_set->removeItemFromAllSets($this->tableNum(), $this->getPrimaryKey());
}
if ($vs_batch_mode == '_delete_') {
$t_set->removeItemFromAllSets($this->tableNum(), $this->getPrimaryKey());
break;
}
}
foreach ($_REQUEST as $vs_key => $vs_value) {
if (!preg_match("/{$vs_placement_code}{$vs_form_prefix}_set_id_new_([\\d]+)/", $vs_key, $va_matches)) {
continue;
}
$vn_c = intval($va_matches[1]);
if ($vn_new_set_id = $po_request->getParameter("{$vs_placement_code}{$vs_form_prefix}_set_id_new_{$vn_c}", pString)) {
$t_set->load($vn_new_set_id);
$t_set->addItem($this->getPrimaryKey(), null, $po_request->getUserID());
if ($t_set->numErrors()) {
$po_request->addActionErrors($t_set->errors(), $vs_f);
}
}
}
break;
# -------------------------------------
// This bundle is only available for types which support set membership
# -------------------------------------
// This bundle is only available for types which support set membership
case 'ca_set_items':
if ($vb_batch) {
break;
}
// not supported in batch mode
// check for existing labels to delete (no updating supported)
require_once __CA_MODELS_DIR__ . '/ca_sets.php';
require_once __CA_MODELS_DIR__ . '/ca_set_items.php';