本文整理匯總了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;
}