本文整理汇总了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';