Builds the rename map which is used as a lookup table for normalizeFieldData()

@return void
328000
private function buildRenameMap()
    {
        $renameMap = $this->config()->rename;

        if (!$renameMap) {
            return;
        }

        $prefix = $this->getGatewayFieldName('prefix');
        // if a prefix has already been defined in the gateway namespace, continue using it
        // if not, and we have a global prefix, use that.
        // if not, $prefix becomes an empty string
        $prefix = ($prefix) ? $prefix : ($this->getGlobalFieldName('prefix') ?: '');

        foreach ($this->config()->whitelist as $defaultName) {
            // Gateway Rename Support
            if (array_key_exists($this->gateway, $renameMap)) {
                if ($this->getGlobalFieldName($this->gateway) && $customName = $this->getGatewayFieldName($defaultName)) {
                    // we have a gateway defined custom field name for $defaultName
                    $this->renamemap[$defaultName] =  $prefix . $customName;
                    continue;
                }

                // no gateway defined custom field name was found for $defaultName, continuing will fallback to the global map
            }

            //Global Rename
            if ($customName = $this->getGlobalFieldName($defaultName)) {
                $this->renamemap[$defaultName] =  $prefix . $customName;
                continue;
            }

            // at this point, no defined custom field names were found in either the global or gateway namespace of the
            // rename.yml configuration file, return the input as is with our prefix prepended if it has been defined
            $this->renamemap[$defaultName] = $prefix . $defaultName;
        }
    }
57816
private function set_field_names()
    {
        foreach ( $this->config->fields as $field )
        {
            $field->init_name = $field->name;
        }
    }
977991
def rename_keys(options, map = {})
      Hash[options.map { |k, v| [map[k] || k, v] }]
    end
276443
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(DealerContactVersionTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(DealerContactVersionTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new DealerContactVersionTableMap());
      }
    }
848388
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(IndexEngineIndexTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(IndexEngineIndexTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new IndexEngineIndexTableMap());
        }
    }
1180973
public function renameField($fieldName, $newFieldTitle)
    {
        $field = $this->dataFieldByName($fieldName);
        if (!$field) {
            return false;
        }

        $field->setTitle($newFieldTitle);

        return $field->Title() == $newFieldTitle;
    }
876348
public static function buildTableMap()
    {
      $dbMap = Propel::getServiceContainer()->getDatabaseMap(DealerContactInfoVersionTableMap::DATABASE_NAME);
      if (!$dbMap->hasTable(DealerContactInfoVersionTableMap::TABLE_NAME)) {
        $dbMap->addTableObject(new DealerContactInfoVersionTableMap());
      }
    }
157536
public static function buildTableMap()
    {
      $dbMap = Propel::getDatabaseMap(BaseUserRolePeer::DATABASE_NAME);
      if (!$dbMap->hasTable(BaseUserRolePeer::TABLE_NAME)) {
        $dbMap->addTableObject(new \Slashworks\BackendBundle\Model\map\UserRoleTableMap());
      }
    }
159962
private function applyRenames()
    {
        foreach ($this->renames as $rename) {
            $mainMenuOriginal = $rename[0];
            $subMenuOriginal  = $rename[1];
            $mainMenuRenamed  = $rename[2];
            $subMenuRenamed   = $rename[3];

            // Are we changing a submenu?
            if (!empty($subMenuOriginal)) {
                if (isset($this->menu[$mainMenuOriginal][$subMenuOriginal])) {
                    $save = $this->menu[$mainMenuOriginal][$subMenuOriginal];
                    $save['_name'] = $subMenuRenamed;
                    unset($this->menu[$mainMenuOriginal][$subMenuOriginal]);
                    $this->menu[$mainMenuRenamed][$subMenuRenamed] = $save;
                }
            } // Changing a first-level element
            elseif (isset($this->menu[$mainMenuOriginal])) {
                $save = $this->menu[$mainMenuOriginal];
                $save['_name'] = $mainMenuRenamed;
                unset($this->menu[$mainMenuOriginal]);
                $this->menu[$mainMenuRenamed] = $save;
            }
        }
    }
1000694
public function _fixFieldData()
    {
        $fieldMap = $this->getTrackEngine()->getFieldCodes();

        foreach ($this->_fieldData as $key => $value) {
            if (isset($fieldMap[$key])) {
                // The old name remains in the data set of course,
                // using the code is a second occurence
                $this->_fieldData[$fieldMap[$key]] = $value;
            }
        }
    }
1136045
public static function buildTableMap()
    {
        $dbMap = Propel::getServiceContainer()->getDatabaseMap(SmartyFilterTableMap::DATABASE_NAME);
        if (!$dbMap->hasTable(SmartyFilterTableMap::TABLE_NAME)) {
            $dbMap->addTableObject(new SmartyFilterTableMap());
        }
    }
170268
public function renameModelsAndRepositories()
    {
        $moduleDir = base_path('Modules/'.$this->module);
        $paths = [
            $moduleDir.'/Models/Object.php',
            $moduleDir.'/Facades/Objects.php',
            $moduleDir.'/Repositories/EloquentObject.php',
            $moduleDir.'/resources/scss/public/_object.scss',
            $moduleDir.'/resources/scss/public/_object-list.scss',
        ];
        foreach ($paths as $path) {
            $this->files->move($path, $this->transformFilename($path));
        }
    }
773973
protected function renameDatabaseTableField($table, $oldFieldName, $newFieldName)
    {
        $title = 'Renaming "' . $table . ':' . $oldFieldName . '" to "' . $table . ':' . $newFieldName . '": ';

        $currentTableFields = $this->databaseConnection->admin_get_fields($table);

        if ($currentTableFields[$newFieldName]) {
            $message = 'Field ' . $table . ':' . $newFieldName . ' already existing.';
            $status = FlashMessage::OK;
        } else {
            if (!$currentTableFields[$oldFieldName]) {
                $message = 'Field ' . $table . ':' . $oldFieldName . ' not existing';
                $status = FlashMessage::ERROR;
            } else {
                $sql = 'ALTER TABLE ' . $table . ' CHANGE COLUMN ' . $oldFieldName . ' ' . $newFieldName . ' ' .
                    $currentTableFields[$oldFieldName]['Type'];

                if ($this->databaseConnection->admin_query($sql) === false) {
                    $message = ' SQL ERROR: ' . $this->databaseConnection->sql_error();
                    $status = FlashMessage::ERROR;
                } else {
                    $message = 'OK!';
                    $status = FlashMessage::OK;
                }
            }
        }

        $this->addMessage($status, $title, $message);

        return $status;
    }
253753
private function renameKey()
    {
        try {
            list($file, $key) = explode('.', $this->argument('oldKey'), 2);
        } catch (\ErrorException $e) {
            $this->error('Could not recognize the key you want to rename.');

            return;
        }

        if (Str::contains($this->argument('newKey'), '.')) {
            $this->error('Please provide the new key must not contain a dot.');

            return;
        }

        $newKey = preg_replace('/(\w+)$/i', $this->argument('newKey'), $key);

        $files = $this->manager->files()[$file];

        $currentValues = [];

        foreach ($files as $languageKey => $filePath) {
            $content = Arr::dot($this->manager->getFileContent($filePath));

            $currentValues[$languageKey] = isset($content[$key]) ? $content[$key] : '';
        }

        $this->manager->removeKey($file, $key);

        $this->manager->fillKeys(
            $file,
            [$newKey => $currentValues]
        );
    }
1372185
protected function buildNameIndex() : void
    {
        foreach ($this->routes as $key => $route) {
            if (! is_null($route->getName())) {
                unset($this->routes[$key]);
                $this->namedRoutes[$route->getName()] = $route;
            }
        }
    }
555562
protected function buildMapperFields()
    {
        $fields       = array();
        $dataNamesMap = '';

        foreach ($this->columns as $column) {
            $field    = $column->getName();
            $fields[] = "        '" . $field . "'";
            $dataNamesMap .= "
        '" . $field . "' => array(
            'get'      => '" . $column->getMethodNameGet() . "',
            'set'      => '" . $column->getMethodNameSet() . "',
            'property' => '" . $column->getPropertyName() . "',
        ),";
        }

        $this->vars['db_fields']      = implode(",\n", $fields);
        $this->vars['data_names_map'] = $dataNamesMap;
    }
833811
public function changedFieldNames()
    {
        $diffed = clone $this->fromRecord;
        $fields = array_keys($diffed->toMap());

        $changedFields = [];

        foreach ($fields as $field) {
            if (in_array($field, $this->ignoredFields)) {
                continue;
            }
            if ($this->fromRecord->$field != $this->toRecord->$field) {
                $changedFields[] = $field;
            }
        }

        return $changedFields;
    }