SwatDB/SwatDBRecordsetWrapper.php
public function save()
    {
        $this->checkDB();
        $transaction = new SwatDBTransaction($this->db);
        try {
            foreach ($this->removed_objects as $object) {
                $object->setDatabase($this->db);
                $object->delete();
            }

            foreach ($this->objects as $object) {
                $object->setDatabase($this->db);
                $object->save();
            }

            $transaction->commit();
        } catch (Exception $e) {
            $transaction->rollback();
            throw $e;
        }

        $this->removed_objects = array();
        $this->reindex();
    }
public function save()
    {
        $this->checkDB();
        $transaction = new SwatDBTransaction($this->db);
        try {
            foreach ($this->removed_objects as $object) {
                $object->setDatabase($this->db);
                $object->delete();
            }

            foreach ($this->objects as $object) {
                $object->setDatabase($this->db);
                $object->save();
            }

            $transaction->commit();
        } catch (Exception $e) {
            $transaction->rollback();
            throw $e;
        }

        $this->removed_objects = array();
        $this->reindex();
    }
public function save ( ) { $ this -> checkDB ( ) ; $ transaction = new SwatDBTransaction ( $ this -> db ) ; try { foreach ( $ this -> removed_objects as $ object ) { $ object -> setDatabase ( $ this -> db ) ; $ object -> delete ( ) ; } foreach ( $ this -> objects as $ object ) { $ object -> setDatabase ( $ this -> db ) ; $ object -> save ( ) ; } $ transaction -> commit ( ) ; } catch ( Exception $ e ) { $ transaction -> rollback ( ) ; throw $ e ; } $ this -> removed_objects = array ( ) ; $ this -> reindex ( ) ; }
Saves this recordset to the database

Saving a recordset works as follows:
1. Objects that were removed are deleted from the database.
2. Objects that were added are inserted into the database,
3. Objects that were modified are updated in the database,

Deleting is performed before adding incase a new row with the same
values as a deleted row is added. For example, a binding is removed and
an identical binding is added.
Saves this recordset to the database