本文整理汇总了PHP中DaoFactory::StockMovercvD方法的典型用法代码示例。如果您正苦于以下问题:PHP DaoFactory::StockMovercvD方法的具体用法?PHP DaoFactory::StockMovercvD怎么用?PHP DaoFactory::StockMovercvD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DaoFactory
的用法示例。
在下文中一共展示了DaoFactory::StockMovercvD方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: perform
/**
* xxxの保存が成功したかJSON形式で返す
* @access public
* @see Admin_ActionClass::perform()
*/
function perform()
{
$flg = $this->af->get('flg');
$company_id = $this->session->get('company_id');
try {
$params = array('company_id' => $company_id);
$methodarr = array();
$methodarr[] = 'setStockMovercvMDShohinCdNullForGtin14';
$methodarr[] = 'setStockMovercvMDShohinCdNullForBarcode';
$methodarr[] = 'setStockMovercvMDShohinCdNullByAi';
$dao = DaoFactory::StockMovercvD();
$dao->BeginTransaction();
// 一覧を取得
$null_num_before = $dao->getStockMovercvMDShohinCdNullCount($params);
foreach ($methodarr as $method) {
$res = $dao->{$method}($params);
if (!$res) {
throw new Exception("DB更新が失敗しました");
}
}
$null_num_after = $dao->getStockMovercvMDShohinCdNullCount($params);
$dao->CommitTransaction();
$dir = dirname(BASE) . DIRECTORY_SEPARATOR . 'batch';
exec('php ' . $dir . DIRECTORY_SEPARATOR . 'batch_zaiko_all.php ' . $company_id . ' > /dev/null &');
$output = array();
$output['result'] = '0';
$output['updated_count'] = intval($null_num_before) - intval($null_num_after);
$output['null_num'] = $null_num_after;
return array('json', $output);
} catch (Exception $e) {
// 致命的なエラーが発生
$dao->AbortTransaction();
$this->logger->log(LOG_DEBUG, $e->getTraceAsString());
return array('500', $e->getMessage());
}
exit;
}