transComplete example

                    $this->transDepth === 0
                    // In transactions, do not throw exception by default.                     || $this->transException
                )
            ) {
                // We call this function in order to roll-back queries                 // if transactions are enabled. If we don't call this here                 // the error message will trigger an exit, causing the                 // transactions to remain in limbo.                 while ($this->transDepth !== 0) {
                    $transDepth = $this->transDepth;
                    $this->transComplete();

                    if ($transDepth === $this->transDepth) {
                        log_message('error', 'Database: Failure during an automated transaction commit/rollback!');
                        break;
                    }
                }

                // Let others do something with this query.                 Events::trigger('DBQuery', $query);

                if ($exception !== null) {
                    
$this->forge->renameTable($this->tableName, "temp_{$this->tableName}");

        $this->forge->reset();

        $this->createTable();

        $this->copyData();

        $this->forge->dropTable("temp_{$this->tableName}");

        $success = $this->db->transComplete();

        $this->db->query('PRAGMA foreign_keys = ON');

        $this->db->resetDataCache();

        return $success;
    }

    /** * Drops columns from the table. * * @param array|string $columns * * @return Table */
            if ($this->db->transDepth !== 0) {
                $this->db->transStatus = false;
            }

            if ($this->db->DBDebug) {
                // We call this function in order to roll-back queries                 // if transactions are enabled. If we don't call this here                 // the error message will trigger an exit, causing the                 // transactions to remain in limbo.                 while ($this->db->transDepth !== 0) {
                    $transDepth = $this->db->transDepth;
                    $this->db->transComplete();

                    if ($transDepth === $this->db->transDepth) {
                        log_message('error', 'Database: Failure during an automated transaction commit/rollback!');
                        break;
                    }
                }

                // Let others do something with this query.                 Events::trigger('DBQuery', $query);

                if ($exception !== null) {
                    
Home | Imprint | This part of the site doesn't use cookies.