Exemplo n.º 1
0
 public function doUpdate()
 {
     if (!$this->callback) {
         return;
     }
     $autoTrx = $this->dbw->getFlag(DBO_TRX);
     $this->dbw->clearFlag(DBO_TRX);
     try {
         /** @var Exception $e */
         $e = null;
         call_user_func_array($this->callback, [$this->dbw, $this->fname]);
     } catch (Exception $e) {
     }
     if ($autoTrx) {
         $this->dbw->setFlag(DBO_TRX);
     }
     if ($e) {
         throw $e;
     }
 }
Exemplo n.º 2
0
 /**
  * @param IDatabase $conn
  */
 private function undoTransactionRoundFlags(IDatabase $conn)
 {
     if ($conn->getFlag($conn::DBO_DEFAULT)) {
         $conn->restoreFlags($conn::RESTORE_PRIOR);
     }
 }