Rename the current field.

@see Builder::rename()
@see http://docs.mongodb.org/manual/reference/operator/rename/
@param string $name
@return $this
764206
public function rename($name)
    {
        $this->requiresCurrentField();
        $this->newObj['$rename'][$this->currentField] = $name;
        return $this;
    }
835303
public function setName($name)
	{
		// Check if we need to make this an array
		$endsWithBrackets = substr_compare($name, '[]', -2, 2) === 0;
		if ($this->isAutoArray() && ! $endsWithBrackets)
		{
			$name .= '[]';
		}

		$this->itSetName($name);

		// For any children, update the name
		foreach ($this->getContents() as $item)
		{
			$item->setName($this->getName());
		}

		return $this;
	}
47795
public function rename($name) {

		if(false === is_string($name)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
		}

		if(false !== $this -> file -> getExists()) {
			
			if(rename($this -> file -> getBasepath(), $this -> file -> getPath() . $name)) {

				$info = (object) pathinfo($this -> file -> getPath() . $name);

				$this -> file -> setName($info -> filename);
				$this -> file -> setBasename($info -> basename);
				$this -> file -> setBasepath($this -> file -> getPath() . $this -> file -> getBasename());
				
				if(true === isset($info -> extension)) {
					$this -> file -> setExtension($info -> extension);
				}

				$this -> refresh();
			}
		}

		return $this;
	}
1214394
protected function renameColumn($name, \Doctrine\DBAL\Schema\Column $col) {
		$res = "\n\t\$table->rename('$name', '".$col->getName()."');";

		return $res;
	}
459903
public function changeExtension($rename)
    {
        $search = '';
        $replace = '';

        if (is_array($rename)) {
            $search = key($rename);
            $replace = current($rename);
        }

        if (is_string($rename)) {
            $search = pathinfo($this->outputPathname, PATHINFO_EXTENSION);
            $replace = $rename;
        }

        $this->outputPathname = preg_replace("#$search\$#", $replace, $this->outputPathname);

        return $this;
    }
1205576
public function renameTo($name)
	{
		if (strpos($name, DIRECTORY_SEPARATOR) !== 0)
		{
			$name = pathinfo($this->path, PATHINFO_DIRNAME).DIRECTORY_SEPARATOR.$name;
		}

		if ( ! pathinfo($name, PATHINFO_EXTENSION))
		{
			$name .= '.'.pathinfo($this->path, PATHINFO_EXTENSION);
		}

		if ($result = rename($this->path, $name))
		{
			$this->path = realpath($name);
		}

		return $result;
	}
909442
public function addName($name)
    {
        if (!in_array('names', $this->setFields)) {
            $this->setFields[] = 'names';
        }
        $this->names[] = $name;

        return $this;
    }
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);
    }
1181529
public function setName($name)
    {
        if ($this->name && $this->name !== $name) {
            user_error("DBField::setName() shouldn't be called once a DBField already has a name."
                . "It's partially immutable - it shouldn't be altered after it's given a value.", E_USER_WARNING);
        }

        $this->name = $name;

        return $this;
    }
825194
public function changeName($name)
    {
        return new Contact(
            Connection::sendCurlRequest(Connection::URL_CONTACTS . '/' . $this->iden, 'POST', ['name' => $name], true,
                $this->apiKey), $this->apiKey
        );
    }
497700
public function setName($name) {
        $this->name = $name;
        $arg = pathinfo($name, PATHINFO_EXTENSION);
        if (!empty($arg)) {
            $this->extension = $arg;
        }
        return $this;
    }
791015
public function setName( $name )
   {

      if ( $this->_name === $name ) { return $this; }

      $this->_name = $name;

      $this->notify( [ 'property' => 'name' ] );

      return $this;

   }
653631
public function setName($name)
    {
        $this->name = (string)$name;
        $this->getEntry()
             ->setName($this->name);
        return $this;
    }
727879
public function instanceName($name = null)
    {
        if ($name === null) {
            return $this->instanceName;
        }

        // Rename:
        unset(self::$instances[$this->instanceName]);
        $this->instanceName = $name;
        self::$instances[$name] = $this;
        return $this;
    }
980708
private function rename(): RenameCommand
    {
        $name = $this->asksForApplicationName();

        if (File::exists($this->app->basePath($name))) {
            $this->app->abort(403, 'Folder or file already exists.');
        } else {
            $this->renameBinary($name)
                ->updateComposer($name);
        }

        return $this;
    }
193315
public function removeFieldByName($name)
    {
        foreach ($this->fields as $i => $field) {
            if ($field->getName() == $name) {
                unset($this->fields[$i]);
                break;
            }
        }

        return $this;
    }
336495
public function setName($name)
    {
        if ($this->isNameValid($name) !== true) {
            throw new InvalidArgumentException('The name is not valid.');
        }

        $this->name = $name;

        return $this;
    }