本文整理汇总了PHP中KLogger::logAlert方法的典型用法代码示例。如果您正苦于以下问题:PHP KLogger::logAlert方法的具体用法?PHP KLogger::logAlert怎么用?PHP KLogger::logAlert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KLogger
的用法示例。
在下文中一共展示了KLogger::logAlert方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importDataFromSource
//.........这里部分代码省略.........
$o_event->beginItem($vn_row, $t_subject->tableNum(), 'I');
$t_subject->setMode(ACCESS_WRITE);
$t_subject->set($vs_type_id_fld, $vs_type);
if ($vb_idno_is_template) {
$t_subject->setIdnoWithTemplate($vs_idno);
} else {
$t_subject->set($vs_idno_fld, $vs_idno, array('assumeIdnoForRepresentationID' => true, 'assumeIdnoStubForLotID' => true));
// assumeIdnoStubForLotID forces ca_objects.lot_id values to always be considered as a potential idno_stub first, before use as a ca_objects.lot_id
}
// Look for parent_id in the content tree
$vs_parent_id_fld = $t_subject->getProperty('HIERARCHY_PARENT_ID_FLD');
foreach ($va_content_tree as $vs_table_name => $va_content) {
if ($vs_table_name == $vs_subject_table) {
foreach ($va_content as $va_element_data) {
foreach ($va_element_data as $vs_element => $va_element_content) {
switch ($vs_element) {
case $vs_parent_id_fld:
if ($va_element_content[$vs_parent_id_fld]) {
$t_subject->set($vs_parent_id_fld, $va_element_content[$vs_parent_id_fld], array('treatParentIDAsIdno' => true));
}
break;
}
}
}
}
}
foreach ($va_mandatory_field_mapping_ids as $vs_mandatory_field => $vn_mandatory_mapping_item_id) {
$t_subject->set($vs_mandatory_field, $va_mandatory_field_values[$vs_mandatory_field], array('assumeIdnoStubForLotID' => true));
}
$t_subject->insert();
if ($vs_error = DataMigrationUtils::postError($t_subject, _t("Could not insert new record"), array('dontOutputLevel' => true, 'dontPrint' => true))) {
ca_data_importers::logImportError($vs_error, $va_log_import_error_opts);
if ($vs_import_error_policy == 'stop') {
$o_log->logAlert(_t('Import stopped due to import error policy'));
if ($vb_use_ncurses) {
ncurses_end();
}
$o_event->endItem($t_subject->getPrimaryKey(), __CA_DATA_IMPORT_ITEM_FAILURE__, _t('Failed to import %1', $vs_idno));
if ($o_trans) {
$o_trans->rollback();
}
return false;
}
continue;
}
$o_log->logDebug(_t('Created idno %1 at %2 seconds', $vs_idno, $t->getTime(4)));
} else {
$o_event->beginItem($vn_row, $t_subject->tableNum(), 'U');
// update
$t_subject->setMode(ACCESS_WRITE);
if ($vb_idno_is_template) {
$t_subject->setIdnoWithTemplate($vs_idno);
} else {
$t_subject->set($vs_idno_fld, $vs_idno, array('assumeIdnoStubForLotID' => true));
// assumeIdnoStubForLotID forces ca_objects.lot_id values to always be considered as a potential idno_stub first, before use as a ca_objects.lot_di
}
$t_subject->update();
if ($vs_error = DataMigrationUtils::postError($t_subject, _t("Could not update matched record"), array('dontOutputLevel' => true, 'dontPrint' => true))) {
ca_data_importers::logImportError($vs_error, $va_log_import_error_opts);
if ($vs_import_error_policy == 'stop') {
$o_log->logAlert(_t('Import stopped due to import error policy'));
if ($vb_use_ncurses) {
ncurses_end();
}
$o_event->endItem($t_subject->getPrimaryKey(), __CA_DATA_IMPORT_ITEM_FAILURE__, _t('Failed to import %1', $vs_idno));
if ($o_trans) {