public static function extract_record($row, $prefix = null) {
        if ($prefix === null) {
            $prefix = str_replace('_', '', static::TABLE) . '_';
        }
        $prefixlength = strlen($prefix);

        $data = new stdClass();
        foreach ($row as $property => $value) {
            if (strpos($property, $prefix) === 0) {
                $propertyname = substr($property, $prefixlength);
                $data->$propertyname = $value;
            }
        }

        return $data;
    }