本文整理汇总了PHP中ca_occurrences::getIDNoPlugInInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP ca_occurrences::getIDNoPlugInInstance方法的具体用法?PHP ca_occurrences::getIDNoPlugInInstance怎么用?PHP ca_occurrences::getIDNoPlugInInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ca_occurrences
的用法示例。
在下文中一共展示了ca_occurrences::getIDNoPlugInInstance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOccurrenceID
//.........这里部分代码省略.........
$o_event->beginItem($vs_event_source, 'ca_occurrences', 'I');
}
$t_occurrence->setMode(ACCESS_WRITE);
$t_occurrence->set('locale_id', $pn_locale_id);
$t_occurrence->set('type_id', $pn_type_id);
$t_occurrence->set('parent_id', $pn_parent_id);
$t_occurrence->set('source_id', isset($pa_values['source_id']) ? $pa_values['source_id'] : null);
$t_occurrence->set('access', isset($pa_values['access']) ? $pa_values['access'] : 0);
$t_occurrence->set('status', isset($pa_values['status']) ? $pa_values['status'] : 0);
$t_occurrence->set('idno', $vs_idno);
$t_occurrence->set('hier_occurrence_id', isset($pa_values['hier_occurrence_id']) ? $pa_values['hier_occurrence_id'] : null);
$t_occurrence->insert();
if ($t_occurrence->numErrors()) {
if (isset($pa_options['outputErrors']) && $pa_options['outputErrors']) {
print "[Error] " . _t("Could not insert occurrence %1: %2", $ps_occ_name, join('; ', $t_occurrence->getErrors())) . "\n";
}
if ($o_log) {
$o_log->logError(_t("Could not insert occurrence %1: %2", $ps_occ_name, join('; ', $t_occurrence->getErrors())));
}
return null;
}
$vb_label_errors = false;
$t_occurrence->addLabel(array('name' => $ps_occ_name), $pn_locale_id, null, true);
if ($t_occurrence->numErrors()) {
if (isset($pa_options['outputErrors']) && $pa_options['outputErrors']) {
print "[Error] " . _t("Could not set preferred label for occurrence %1: %2", $ps_occ_name, join('; ', $t_occurrence->getErrors())) . "\n";
}
if ($o_log) {
$o_log->logError(_t("Could not set preferred label for occurrence %1: %2", $ps_occ_name, join('; ', $t_occurrence->getErrors())));
}
$vb_label_errors = true;
}
/** @var IIDNumbering $o_idno */
if ($o_idno = $t_occurrence->getIDNoPlugInInstance()) {
$va_values = $o_idno->htmlFormValuesAsArray('idno', $vs_idno);
if (!($vs_sep = $o_idno->getSeparator())) {
$vs_sep = '';
}
if (!is_array($va_values)) {
$va_values = array($va_values);
}
if (($vs_proc_idno = join($vs_sep, $va_values)) && $vs_proc_idno != $vs_idno) {
$t_occurrence->set('idno', $vs_proc_idno);
$t_occurrence->update();
if ($t_occurrence->numErrors()) {
if (isset($pa_options['outputErrors']) && $pa_options['outputErrors']) {
print "[Error] " . _t("Could not update idno for %1: %2", $ps_occ_name, join('; ', $t_occurrence->getErrors())) . "\n";
}
if ($o_log) {
$o_log->logError(_t("Could not idno for %1: %2", $ps_occ_name, join('; ', $t_occurrence->getErrors())));
}
return null;
}
}
}
unset($pa_values['access']);
unset($pa_values['status']);
unset($pa_values['idno']);
unset($pa_values['source_id']);
unset($pa_values['hier_occurrence_id']);
$vb_attr_errors = false;
if (is_array($pa_values)) {
foreach ($pa_values as $vs_element => $va_values) {
if (!caIsIndexedArray($va_values)) {
$va_values = array($va_values);
}