Source for file TransactionManager.php

Documentation is available at TransactionManager.php

  1. <?php
  2. /**
  3.  * Teeple2 - PHP5 Web Application Framework inspired by Seasar2
  4.  *
  5.  * PHP versions 5
  6.  *
  7.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  8.  * that is available through the world-wide-web at the following URI:
  9.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  10.  * the PHP License and are unable to obtain it through the web, please
  11.  * send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @package     teeple
  14.  * @author      Mitsutaka Sato <miztaka@gmail.com>
  15.  * @license     http://www.php.net/license/3_0.txt  PHP License 3.0
  16.  */
  17.  
  18. /**
  19.  * TransactionManager - トランザクションを管理するクラスです。
  20.  * 
  21.  * @package teeple
  22.  *
  23.  */
  24.     
  25.     /**
  26.      * @var Teeple_Container 
  27.      */
  28.     private $container;
  29.     public function setComponent_container($c{
  30.         $this->container $c;
  31.     }
  32.     
  33.     private $txs array();
  34.     
  35.     /**
  36.      * 新しいトランザクションを取得します。
  37.      *
  38.      * @return Teeple_Transaction 
  39.      */
  40.     public function getTransaction({
  41.         $tx $this->container->getPrototype('Teeple_Transaction');
  42.         $this->txs[$tx;
  43.         return $tx;
  44.     }
  45.     
  46.     /**
  47.      * 全てのトランザクションをコミットします。
  48.      *
  49.      */
  50.     public function commitAll({
  51.         foreach($this->txs as $tx{
  52.             if ($tx->isStarted(&& $tx->isClosed()) {
  53.                 $tx->commit();
  54.             }
  55.         }
  56.         return;
  57.     }
  58.     
  59.     /**
  60.      * 全てのトランザクションをロールバックします。
  61.      *
  62.      */
  63.     public function rollbackAll({
  64.         foreach($this->txs as $tx{
  65.             if ($tx->isStarted(&& $tx->isClosed()) {
  66.                 $tx->rollback();
  67.             }
  68.         }
  69.         return;
  70.     }
  71.     
  72. }
  73. ?>

Documentation generated on Mon, 26 Apr 2010 09:00:02 +0900 by phpDocumentor 1.4.3