当前位置: 首页>>代码示例>>PHP>>正文


PHP ca_occurrences::getIDNoPlugInInstance方法代码示例

本文整理汇总了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);
                 }
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:67,代码来源:DataMigrationUtils.php


注:本文中的ca_occurrences::getIDNoPlugInInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。