Index Documentation

DbTransaction
in

Represents a transaction to be performed on the database.

Table of Contents

Methods

commit()  : void
Commits the actions done during a transaction and ends the transaction.
release()  : void
Releases a specified save point.
rollback()  : void
Rolls back to the state before a transaction start or to a specified save point.
save()  : void
Creates a save point in the transaction that can be rolled back to.

Methods

commit()

Commits the actions done during a transaction and ends the transaction.

public commit() : void

A new transaction will be started if auto-commit is disabled.

Tags
throws
RuntimeException

If the commit failed.

release()

Releases a specified save point.

public release(string $name) : void
Parameters
$name : string

Name of the save point.

Tags
throws
RuntimeException

If save points are not supported by this implementation.

rollback()

Rolls back to the state before a transaction start or to a specified save point.

public rollback([string|null $name = null ]) : void
Parameters
$name : string|null = null

Name of the save point, null for the entire transaction.

Tags
throws
RuntimeException

If rollback failed.

throws
RuntimeException

If save points are not supported by this implementation and $name was non-null.

save()

Creates a save point in the transaction that can be rolled back to.

public save(string $name) : void
Parameters
$name : string

Name for the save point.

Tags
throws
RuntimeException

If save point creation failed.


        
On this page

Search results