<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Class **Phalcon\Mvc\Model\Transaction\Manager**[](# "永久鏈接至標題") *implements*[*Phalcon\Mvc\Model\Transaction\ManagerInterface*](#), `Phalcon\Di\InjectionAwareInterface` A transaction acts on a single database connection. If you have multiple class-specific databases, the transaction will not protect interaction among them. This class manages the objects that compose a transaction. A trasaction produces a unique connection that is passed to every object part of the transaction. ~~~ <?php try { use Phalcon\Mvc\Model\Transaction\Manager as TransactionManager; $transactionManager = new TransactionManager(); $transaction = $transactionManager->get(); $robot = new Robots(); $robot->setTransaction($transaction); $robot->name = 'WALL?E'; $robot->created_at = date('Y-m-d'); if($robot->save()==false){ $transaction->rollback("Can't save robot"); } $robotPart = new RobotParts(); $robotPart->setTransaction($transaction); $robotPart->type = 'head'; if($robotPart->save()==false){ $transaction->rollback("Can't save robot part"); } $transaction->commit(); } catch (Phalcon\Mvc\Model\Transaction\Failed $e) { echo 'Failed, reason: ', $e->getMessage(); } ~~~ ### Methods[](# "永久鏈接至標題") public **__construct** ([*unknown* $dependencyInjector]) Phalcon\Mvc\Model\Transaction\Manager constructor public **setDI** (*unknown* $dependencyInjector) Sets the dependency injection container public **getDI** () Returns the dependency injection container public **setDbService** (*unknown* $service) Sets the database service used to run the isolated transactions public *string***getDbService** () Returns the database service used to isolate the transaction public **setRollbackPendent** (*unknown* $rollbackPendent) Set if the transaction manager must register a shutdown function to clean up pendent transactions public **getRollbackPendent** () Check if the transaction manager is registering a shutdown function to clean up pendent transactions public **has** () Checks whether the manager has an active transaction public **get** ([*unknown* $autoBegin]) Returns a new \Phalcon\Mvc\Model\Transaction or an already created once This method registers a shutdown function to rollback active connections public **getOrCreateTransaction** ([*unknown* $autoBegin]) Create/Returns a new transaction or an existing one public **rollbackPendent** () Rollbacks active transactions within the manager public **commit** () Commmits active transactions within the manager public **rollback** ([*boolean* $collect]) Rollbacks active transactions within the manager Collect will remove the transaction from the manager public **notifyRollback** (*unknown* $transaction) Notifies the manager about a rollbacked transaction public **notifyCommit** (*unknown* $transaction) Notifies the manager about a commited transaction protected **_collectTransaction** (*unknown* $transaction) Removes transactions from the TransactionManager public **collectTransactions** () Remove all the transactions from the manager | - [索引](# "總目錄") - [下一頁](# "Class Phalcon\Mvc\Model\ValidationFailed") | - [上一頁](# "Class Phalcon\Mvc\Model\Transaction\Failed") | - [API Indice](#) ?
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看