YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* トランザクション [#k19e4f1d]
public function transferMoney($fromAccountNumber, $toAcc...
{
// get the PDO connection object from Propel
$con = Propel::getConnection(AccountPeer::DATABASE_NAME);
$fromAccount = AccountPeer::retrieveByPk($fromAccountNu...
$toAccount = AccountPeer::retrieveByPk($toAccountNumb...
$con->beginTransaction();
try {
// remove the amount from $fromAccount
$fromAccount->setValue($fromAccount->getValue() - $am...
$fromAccount->save($con);
// add the amount to $toAccount
$toAccount->setValue($toAccount->getValue() + $amount);
$toAccount->save($con)
$con->commit();
} catch (Exception $e) {
$con->rollback();
throw $e;
}
}
http://www.propelorm.org/wiki/Documentation/1.4/Transacti...
終了行:
* トランザクション [#k19e4f1d]
public function transferMoney($fromAccountNumber, $toAcc...
{
// get the PDO connection object from Propel
$con = Propel::getConnection(AccountPeer::DATABASE_NAME);
$fromAccount = AccountPeer::retrieveByPk($fromAccountNu...
$toAccount = AccountPeer::retrieveByPk($toAccountNumb...
$con->beginTransaction();
try {
// remove the amount from $fromAccount
$fromAccount->setValue($fromAccount->getValue() - $am...
$fromAccount->save($con);
// add the amount to $toAccount
$toAccount->setValue($toAccount->getValue() + $amount);
$toAccount->save($con)
$con->commit();
} catch (Exception $e) {
$con->rollback();
throw $e;
}
}
http://www.propelorm.org/wiki/Documentation/1.4/Transacti...
ページ名: