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;
    }