function transformData(&$data, $toLocal)
 {
     // Check if it is already in correct format
     if (isset($data['_info']['format'])) {
         if ($data['_info']['format'] == ($toLocal ? 'local' : 'generic')) {
             return true;
         }
     }
     // Set the new format it will get
     $data['_info']['format'] = $toLocal ? 'local' : 'generic';
     // load the schema transformation rules
     $schemaType = $this->schemaType();
     $schemaTransformationRules = eZDBSchemaInterface::loadSchemaTransformationRules($schemaType);
     if ($schemaTransformationRules === false) {
         return false;
     }
     // transform column names
     foreach ($schemaTransformationRules['column-name'] as $key => $val) {
         list($tableName, $genericColName) = explode('.', $key);
         $localColName = $val;
         if ($toLocal) {
             $searchColName = $genericColName;
             $replacementColName = $localColName;
         } else {
             $searchColName = $localColName;
             $replacementColName = $genericColName;
         }
         if (!isset($data[$tableName])) {
             continue;
         }
         // transform column names in tables
         $fieldsData = $data[$tableName]['fields'];
         foreach ($fieldsData as $key => $fieldName) {
             if ($searchColName == $fieldName) {
                 $data[$tableName]['fields'][$key] = $replacementColName;
                 eZDebugSetting::writeDebug('lib-dbschema-data-transformation', '', "transformed table column name {$tableName}.{$searchColName} to {$replacementColName}");
             }
         }
     }
     return true;
 }