SwatDB/SwatDBRecordsetWrapper.php
public function attachSubDataObjects(
        $name,
        SwatDBRecordsetWrapper $sub_data_objects
    ) {
        if ($sub_data_objects->index_field === null) {
            throw new SwatDBException(
                sprintf(
                    'Index field must be specified in the sub-data-object ' .
                        'recordset wrapper class (%s::init()) ' .
                        'in order to attach recordset as sub-dataobjects.',
                    get_class($sub_data_objects)
                )
            );
        }

        foreach ($this->objects as $object) {
            $value = $object->getInternalValue($name);
            if (isset($sub_data_objects[$value])) {
                $object->$name = $sub_data_objects[$value];
            }
        }
    }
public function attachSubDataObjects(
        $name,
        SwatDBRecordsetWrapper $sub_data_objects
    ) {
        if ($sub_data_objects->index_field === null) {
            throw new SwatDBException(
                sprintf(
                    'Index field must be specified in the sub-data-object ' .
                        'recordset wrapper class (%s::init()) ' .
                        'in order to attach recordset as sub-dataobjects.',
                    get_class($sub_data_objects)
                )
            );
        }

        foreach ($this->objects as $object) {
            $value = $object->getInternalValue($name);
            if (isset($sub_data_objects[$value])) {
                $object->$name = $sub_data_objects[$value];
            }
        }
    }
public function attachSubDataObjects ( $ name , SwatDBRecordsetWrapper $ sub_data_objects ) { if ( $ sub_data_objects -> index_field === null ) { throw new SwatDBException ( sprintf ( 'Index field must be specified in the sub-data-object ' . 'recordset wrapper class (%s::init()) ' . 'in order to attach recordset as sub-dataobjects.' , get_class ( $ sub_data_objects ) ) ) ; } foreach ( $ this -> objects as $ object ) { $ value = $ object -> getInternalValue ( $ name ) ; if ( isset ( $ sub_data_objects [ $ value ] ) ) { $ object -> $ name = $ sub_data_objects [ $ value ] ; } } }
Attach existing sub-dataobjects for an internal property of the
dataobjects in this recordset

@param string $name name of the property to attach to.
@param SwatDBRecordsetWrapper $sub_data_objects
Attach existing sub - dataobjects for an internal property of the dataobjects in this recordset