protected function translateRow($row, $format) {
        // Apply the row filter.
        if (isset($format['rowfilter'])) {
            call_user_func_array($format['rowfilter'], array(&$row));
        }

        $result = array();
        foreach ($format['columns'] as $key => $cdef) {
            if (array_key_exists($cdef['sourcecolumn'], $row))
                $value = $row[$cdef['sourcecolumn']];
            else
                $value = $cdef['default'];

            if (isset($cdef['filter'])) {
                $value = call_user_func($cdef['filter'], $value, $key, $row);
            }

            $result[$cdef[0]] = $value;
        }
        return $result;
    }