Rename a column in every row. This change is applied recursively to all subtables.

@param string $oldName Old column name.
@param string $newName New column name.
339733
public function renameColumn($oldName, $newName)
    {
        foreach ($this->rows as $row) {
            $row->renameColumn($oldName, $newName);

            $subTable = $row->getSubtable();
            if ($subTable) {
                $subTable->renameColumn($oldName, $newName);
            }
        }
        if (!is_null($this->summaryRow)) {
            $this->summaryRow->renameColumn($oldName, $newName);
        }
        if (!is_null($this->totalsRow)) {
            $this->totalsRow->renameColumn($oldName, $newName);
        }
    }
624979
private function rename(string $oldPath, string $newPath): bool
    {
        if (!@rename($oldPath, $newPath)) {
            $message = 'Could not rename file.';
            if ($error = error_get_last()) {
                $message .= sprintf(' Errno: %d; %s', $error['type'], $error['message']);
            }
            throw new FileException($message);
        }

        return true;
    }
328564
private function renameTable($old, $new) {
        $renameSql = 'alter table '.
            $this->prefixTable($old).
            ' rename to '.
            $this->prefixTable($new);
        $this->queryDefine($renameSql);
    }
568733
public function alterDbTable($model, $oldDbTableName, $newDbTableName)
    {
        if ($oldDbTableName === $newDbTableName) {
            return;
        }
        $this->renameTable($oldDbTableName, $newDbTableName);
    }
1105726
public function rename($new, $old = null)
    {
        $this->arguments[] = 'rename';
        if ($old) {
            $this->arguments[] = $old;
        }
        $this->arguments[] = $new;
        return $this;
    }
226971
public function setName($newName)
    {
        if (!is_string($newName) || preg_match(NodeInterface::MATCH_PATTERN_NAME, $newName) !== 1) {
            throw new \InvalidArgumentException('Invalid node name "' . $newName . '" (a node name must only contain characters, numbers and the "-" sign).', 1364290839);
        }
        $this->name = $newName;
    }
725718
public function renameForeignKey($oldName, $newName)
    {
        if (!$this->hasForeignKey($oldName)) {
            throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasForeignKey($newName)) {
            throw SchemaException::tableForeignKeyAlreadyExists($this->getName(), $newName);
        }

        $this->foreignKeys[$oldName]->setName($newName);
        $this->foreignKeys[$newName] = $this->foreignKeys[$oldName];
        unset($this->foreignKeys[$oldName]);
    }
1115476
public function rename($index, $newName)
    {
        if (!isset($this->names[$index])) {
            return false;
        }
        if ($this->names[$index] === $newName) {
            return false;
        }
        $this->context->getMappings();
        $this->names[$index] = $newName;
        $this->indexes = array_flip($this->names);
        $this->onRename($index, $newName);
        return true;
    }
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;
    }
390487
public final function renameColumn($column, $name)
    {
        $oldName = $column->getName();

        $this->requireColumn($oldName);
        $this->forbidColumn($name);

        $this->_renameColumn($column, $name);
        // Update column cache
        $this->_columns[$name] = $column;
        unset($this->_columns[$oldName]);
        $this->_updateConstraints($oldName, $name);
    }
929722
public function rename($oldname, $newname) {
		$this->connectIfNeeded();
		$this->handle->rename($oldname, $newname);
		$this->onFileRenamed(
			new Event(['sender' => $this, 'data' => [
				'oldname' => $oldname, 
				'newname' => $newname
			]])
		);
	}
604289
public function rename($oldName, $newName)
    {
        if (! ftp_rename($this->session, $oldName, $newName)) {
            throw new \RuntimeException('Name can not be changed');
        }
        return true;
    }
94402
public function move(string $old, string $new){
    if (
      !empty($old) &&
      !empty($new) &&
      ($old = $this->checkFilePath($old)) &&
      ftp_rename($this->cn, $old, $new)
    ){
      return true;
    }
    return false;
  }
1232518
public function rename($oldName, $newName, $pathToFile = null)
    {
        if ($pathToFile==null) {
            $pathToFile=$this->_filePath;
        }
        if (file_exists($pathToFile."/".$oldName)) {
            $this->createDir($pathToFile);
            return rename($pathToFile."/".$oldName, $pathToFile."/".$newName);
        } else {
            return false;
        }
    }
555001
public function rename($oldname, $newname)
    {
        $this->copy($oldname, $newname);

        // Delete the original object
        if ($this->isDir($oldname))
        {
            $this->deleteFolder($oldname);
        } else {
            $this->delete($oldname);
        }

        return true;
    }
1238959
public function renameColumn($old, $new)
    {
        $this->append(sprintf(' RENAME COLUMN %s TO %s ', $this->quote($old), $this->quote($new)));
        return $this;
    }
1271764
protected function remap(&$data, $oldKey, $newKey)
    {
        if ($newKey !== null && $newKey !== false) {
            $data->setProperty($newKey, $data->getProperty($oldKey));
        }

        $data->unsetProperty($oldKey);
    }