/**
  * {@inheritdoc}
  */
 public function rollback()
 {
     if ($this->transactionDepth === 1) {
         parent::rollback();
     }
     $this->transactionDepth -= 1;
     return $this;
 }
Beispiel #2
0
 /**
  * @param string $sql
  * @return Statement
  */
 public function createStatement($sqlOrResource = null)
 {
     $statement = clone $this->statementPrototype;
     if (is_string($sqlOrResource)) {
         $statement->setSql($sqlOrResource);
     } elseif ($sqlOrResource instanceof \mysqli_stmt) {
         $statement->setResource($sqlOrResource);
     }
     $statement->initialize($this->connection->getResource());
     return $statement;
 }
Beispiel #3
0
 /**
  * @return Result
  */
 public function createResult($resource)
 {
     $result = clone $this->resultPrototype;
     $result->initialize($resource, $this->connection->getLastGeneratedValue());
     return $result;
 }