本文整理汇总了PHP中ca_list_items::hasElement方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_list_items::hasElement方法的具体用法?PHP ca_list_items::hasElement怎么用?PHP ca_list_items::hasElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_list_items
的用法示例。
在下文中一共展示了ca_list_items::hasElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListItemID
//.........这里部分代码省略.........
break 2;
}
}
break;
}
case 'idno':
if ($ps_item_idno == '%') {
break;
}
// don't try to match on an unreplaced idno placeholder
$va_criteria = array('idno' => $ps_item_idno ? $ps_item_idno : $vs_plural_label, 'list_id' => $vn_list_id);
if ($vn_parent_id !== false) {
$va_criteria['parent_id'] = $vn_parent_id;
}
if ($vn_item_id = ca_list_items::find($va_criteria, array('returnAs' => 'firstId', 'purifyWithFallback' => true, 'transaction' => $pa_options['transaction']))) {
if ($o_log) {
$o_log->logDebug(_t("Found existing list item %1 (member of list %2) in DataMigrationUtils::getListItemID() using idno with %3", $ps_item_idno, $pm_list_code_or_id, $ps_item_idno));
}
break 2;
}
break;
}
}
if ($vn_item_id) {
DataMigrationUtils::$s_cached_list_item_ids[$vs_cache_key] = $vn_item_id;
if ($o_event) {
$o_event->beginItem($ps_event_source, 'ca_list_items', 'U');
$o_event->endItem($vn_item_id, __CA_DATA_IMPORT_ITEM_SUCCESS__, '');
}
if (($vb_force_update = caGetOption('forceUpdate', $pa_options, false)) || ($vb_return_instance = caGetOption('returnInstance', $pa_options, false))) {
$vb_has_attr = false;
if ($vb_force_update) {
foreach ($pa_values as $vs_element => $va_values) {
if ($t_item->hasElement($vs_element)) {
$vb_has_attr = true;
break;
}
}
}
if ($vb_return_instance || $vb_force_update && $vb_has_attr) {
$t_item = new ca_list_items($vn_item_id);
if (isset($pa_options['transaction']) && $pa_options['transaction'] instanceof Transaction) {
$t_item->setTransaction($pa_options['transaction']);
}
}
$vb_attr_errors = false;
if ($vb_force_update && $vb_has_attr) {
$vb_attr_errors = !DataMigrationUtils::_setAttributes($t_item, $pn_locale_id, $pa_values, $pa_options);
}
if ($o_event) {
if ($vb_attr_errors) {
$o_event->endItem($vn_item_id, __CA_DATA_IMPORT_ITEM_PARTIAL_SUCCESS__, _t("Errors setting field values: %1", join('; ', $t_item->getErrors())));
} else {
$o_event->endItem($vn_item_id, __CA_DATA_IMPORT_ITEM_SUCCESS__, '');
}
}
if ($vb_return_instance) {
return $t_item;
}
}
return $vn_item_id;
}
if (isset($pa_options['dontCreate']) && $pa_options['dontCreate']) {
return false;
}
//