public function begin() { // flush the previous transaction if there is any $this->commit(); // start a new transaction $this->isTransaction = true; }