<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Class Phalcon\\Mvc\\Model\\Transaction # Class **Phalcon\\Mvc\\Model\\Transaction** *implements*[*Phalcon\\Mvc\\Model\\TransactionInterface*](#) Transactions are protective blocks where SQL statements are only permanent if they can all succeed as one atomic action. Phalcon\\Transaction is intended to be used with Phalcon\_Model\_Base. Phalcon Transactions should be created using Phalcon\\Transaction\\Manager. ``` <pre class="calibre14">``` <?php try { $manager = new \Phalcon\Mvc\Model\Transaction\Manager(); $transaction = $manager->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, \[*boolean* $autoBegin\], \[*string* $service\]) Phalcon\\Mvc\\Model\\Transaction constructor public **setTransactionManager** (*unknown* $manager) Sets transaction manager related to the transaction public **begin** () Starts the transaction public **commit** () Commits the transaction public *boolean***rollback** (\[*string* $rollbackMessage\], \[[*Phalcon\\Mvc\\ModelInterface*](#) $rollbackRecord\]) Rollbacks the transaction public **getConnection** () Returns the connection related to transaction public **setIsNewTransaction** (*unknown* $isNew) Sets if is a reused transaction or new once public **setRollbackOnAbort** (*unknown* $rollbackOnAbort) Sets flag to rollback on abort the HTTP connection public **isManaged** () Checks whether transaction is managed by a transaction manager public **getMessages** () Returns validations messages from last save try public **isValid** () Checks whether internal connection is under an active transaction public **setRollbackedRecord** (*unknown* $record) Sets object which generates rollback action | - [索引](# "總目錄") - [下一頁](# "Class Phalcon\Mvc\Model\Transaction\Exception") | - [上一頁](# "Class Phalcon\Mvc\Model\Row") | - [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>

                              哎呀哎呀视频在线观看