本文整理汇总了PHP中SC_Query_Ex::commit方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Query_Ex::commit方法的具体用法?PHP SC_Query_Ex::commit怎么用?PHP SC_Query_Ex::commit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Query_Ex
的用法示例。
在下文中一共展示了SC_Query_Ex::commit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: revert
public function revert(array $migrations)
{
$migrations = $this->sort($migrations, SORT_DESC);
$reverteds = 0;
try {
foreach ($migrations as $migration) {
$this->query->begin();
if (!$this->storage->isAppliedVersion($migration->version)) {
$this->logger->log(sprintf('Revert migration skipped, Already reverted.: {system:"%s", version:"%s"}', $this->storage->system, $migration->version));
continue;
}
$migration->down();
$migration->applied = false;
$this->storage->markReverted($migration->version);
$this->query->commit();
$this->logger->log(sprintf('Revert migration successful: {system:"%s", version:"%s"}', $this->storage->system, $migration->version));
$reverteds++;
}
$this->query->commit();
} catch (Exception $e) {
if ($this->query->inTransaction()) {
$this->query->rollback();
}
$this->logger->log(sprintf('Revert migration failed: {system:"%s", version:"%s"}', $this->storage->system, $migration->version));
throw $e;
}
return $reverteds;
}
示例2: lfDelete
/**
* 受注テーブルの論理削除
*/
function lfDelete($arrOrderId)
{
$objQuery = new SC_Query_Ex();
if (!isset($arrOrderId) || !is_array($arrOrderId)) {
return false;
}
$arrUpdate = array('del_flg' => 1, 'update_date' => 'CURRENT_TIMESTAMP');
$objQuery->begin();
foreach ($arrOrderId as $orderId) {
$objQuery->update('dtb_order', $arrUpdate, 'order_id = ?', array($orderId));
}
$objQuery->commit();
$this->tpl_onload = "window.alert('選択項目を削除しました。');";
return true;
}
示例3: lfDeleteFavoriteProduct
function lfDeleteFavoriteProduct($customer_id, $product_id)
{
$objQuery = new SC_Query_Ex();
$count = $objQuery->count("dtb_customer_favorite_products", "customer_id = ? AND product_id = ?", array($customer_id, $product_id));
if ($count > 0) {
$objQuery->begin();
$objQuery->delete('dtb_customer_favorite_products', "customer_id = ? AND product_id = ?", array($customer_id, $product_id));
$objQuery->commit();
}
}