public function extract_from_result(stdClass $result) : stdClass {
        $record = new stdClass();

        $fieldlist = $this->get_fieldlist();
        foreach ($fieldlist as $fieldalias => $fieldname) {
            if (property_exists($result, $fieldalias)) {
                $record->$fieldname = $result->$fieldalias;
                unset($result->$fieldalias);
            } else {
                debugging("Field '{$fieldname}' not found", DEBUG_DEVELOPER);
            }
        }

        return $record;
    }
public function extract_from_result(stdClass $result) : stdClass {
        $record = new stdClass();

        $fieldlist = $this->get_fieldlist();
        foreach ($fieldlist as $fieldalias => $fieldname) {
            if (property_exists($result, $fieldalias)) {
                $record->$fieldname = $result->$fieldalias;
                unset($result->$fieldalias);
            } else {
                debugging("Field '{$fieldname}' not found", DEBUG_DEVELOPER);
            }
        }

        return $record;
    }
public function extract_from_result ( stdClass $ result ) : stdClass { $ record = new stdClass ( ) ; $ fieldlist = $ this -> get_fieldlist ( ) ; foreach ( $ fieldlist as $ fieldalias => $ fieldname ) { if ( property_exists ( $ result , $ fieldalias ) ) { $ record -> $ fieldname = $ result -> $ fieldalias ; unset ( $ result -> $ fieldalias ) ; } else { debugging ( "Field '{$fieldname}' not found" , DEBUG_DEVELOPER ) ; } } return $ record ; }
Extract fields from the specified result. The fields are removed from the original object.

This function is intended to be used in combination with get_field_select().

@param   stdClass    $result The result retrieved from the database with fields to be extracted
@return  stdClass    The extracted result
Extract fields from the specified result . The fields are removed from the original object .