interface ITransactions (View source)

This interface defines the contract for transaction management in a database connection.

Implementing classes should provide methods to handle database transactions, such as beginning, committing, and rolling back transactions.

Methods

bool
beginTransaction()

This function creates a new transaction, in order to be able to commit or rollback changes made to the database.

bool
commit()

This function commits any changes made to the database during this transaction.

bool
rollback()

This function rolls back any changes made to the database during this transaction and restores the data to its original state.

bool
inTransaction()

This function returns the last ID generated by an auto-increment column, either the last one inserted during the current transaction, or by passing in the optional name parameter.

Details

bool beginTransaction()

This function creates a new transaction, in order to be able to commit or rollback changes made to the database.

Return Value

bool

bool commit()

This function commits any changes made to the database during this transaction.

Return Value

bool

bool rollback()

This function rolls back any changes made to the database during this transaction and restores the data to its original state.

Return Value

bool

bool inTransaction()

This function returns the last ID generated by an auto-increment column, either the last one inserted during the current transaction, or by passing in the optional name parameter.

Return Value

bool