ITransactions
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
This function creates a new transaction, in order to be able to commit or rollback changes made to the database.
This function commits any changes made to the database during this transaction.
This function rolls back any changes made to the database during this transaction and restores the data to its original state.
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.
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.