SwatDB/SwatDBRecordsetWrapper.php
public function setDatabase(MDB2_Driver_Common $db, array $set = array())
    {
        $key = spl_object_hash($this);

        if (isset($set[$key])) {
            // prevent infinite recursion on datastructure cycles
            return;
        }

        $this->db = $db;
        $set[$key] = true;

        foreach ($this->objects as $object) {
            if ($object instanceof SwatDBRecordable) {
                $object->setDatabase($db, $set);
            }
        }
    }
public function setDatabase(MDB2_Driver_Common $db, array $set = array())
    {
        $key = spl_object_hash($this);

        if (isset($set[$key])) {
            // prevent infinite recursion on datastructure cycles
            return;
        }

        $this->db = $db;
        $set[$key] = true;

        foreach ($this->objects as $object) {
            if ($object instanceof SwatDBRecordable) {
                $object->setDatabase($db, $set);
            }
        }
    }
public function setDatabase ( MDB2_Driver_Common $ db , array $ set = array ( ) ) { $ key = spl_object_hash ( $ this ) ; if ( isset ( $ set [ $ key ] ) ) { // prevent infinite recursion on datastructure cycles return ; } $ this -> db = $ db ; $ set [ $ key ] = true ; foreach ( $ this -> objects as $ object ) { if ( $ object instanceof SwatDBRecordable ) { $ object -> setDatabase ( $ db , $ set ) ; } } }
Sets the database driver for this recordset

The database is automatically set for all recordable records of this
recordset.

@param MDB2_Driver_Common $db  the database driver to use for this
recordset.
@param array              $set optional array of objects passed through
recursive call containing all objects that
have been set already. Prevents infinite
recursion.
Sets the database driver for this recordset