Sets the name of the metadata.

@param  string $name

@return MetaData
@throws \InvalidArgumentException Occurs if $name if not a valid string.
483357
public function setName($name)
    {
        if (!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
            throw new \InvalidArgumentException(sprintf('Invalid name for metadata: `%s`.', $name));
        }

        $this->name = $name;

        return $this;
    }
665433
public function setName(string $name): AbstractSuggest
    {
        if (empty($name)) {
            throw new InvalidException('Suggest name has to be set');
        }
        $this->_name = $name;

        return $this;
    }
281485
public function setName($name)
    {
        if ($this->getMultiValue() === true) {
            $name .= $this->getMultiValueSuffix();
        }

        return parent::setName($name);
    }
1203912
final public function setName($name): Command
    {
        if (!$this->namespace) {
            parent::setName($name);
            return $this;
        }
        parent::setName(sprintf('%s:%s', $this->namespace, $name));
        return $this;
    }
16732
public function setName($name)
    {
        if (is_string($name) === false) {
            $msg = "The 'name' argument must be a string value, '" . gettype($name) . "' given.";
            throw new InvalidArgumentException($msg);
        }

        $this->name = $name;
    }
1000099
public static function lookupByName($name)
    {
        if (empty($name)) {
            throw new \InvalidArgumentException('Argument "name" cannot be empty');
        }

        if (!isset(self::$methods_config[$name])) {
            throw new \InvalidArgumentException('Method "' . $name . '" doesn\'t exist');
        }

        return self::$methods_config[$name];
    }
730076
public function setName($name)
    {
        if (empty($name))
            throw new \Exception('Invalid characters in database name:'.$name);
        $this->name = $name;
        return $this;
    }
931256
public function setName($name)
    {
        if (null !== $name) {
            $this->name = (string) $name;
        } else {
            $this->name = $name;
        }

        return $this;
    }
468590
public function setName($name) : self
    {
        if (null === $name || (!is_string($name) && !is_int($name))) {
            throw new \InvalidArgumentException('name must be either an integer or a string.');
        }

        $this->name = $name;

        return $this;
    }
781554
protected function _setName($name)
    {
        if ($this->isIdentifierQuoted($name)) {
            $this->_quoted = true;
            $name          = $this->trimQuotes($name);
        }
        if (strpos($name, '.') !== false) {
            $parts            = explode('.', $name);
            $this->_namespace = $parts[0];
            $name             = $parts[1];
        }
        $this->_name = $name;
    }
336495
public function setName($name)
    {
        if ($this->isNameValid($name) !== true) {
            throw new InvalidArgumentException('The name is not valid.');
        }

        $this->name = $name;

        return $this;
    }
472745
public function setName(string $name) : self
    {
        // from PHP source code
        if (preg_match("/[=,; \t\r\n\013\014]/", $name)) {
            throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name));
        }

        if (empty($name)) {
            throw new \InvalidArgumentException('The cookie name cannot be empty.');
        }

        $this->name = $name;

        return $this;
    }
632427
public function setName($name)
    {
        if (!empty($name) && ctype_print($name)) {
            $this->name = trim($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;
	}
624037
public function setName($name)
    {
        $name = strtolower($name);

        //Check for everything except letters and dashes.  Throw exception if any are found.
        if (preg_match("/[^a-z\-0-9\.]/", $name)) {
            throw new InvalidArgumentException(
                'Page names can only contain letters, numbers, dots, and dashes.'
                . ' No spaces. This page name is invalid: ' . $name
            );
        }

        $this->name = $name;
    }
930379
public function setName(string $name) : core\interfaces\Named
    {
        return parent::setName(ltrim($name, '-'));
    }
961767
public function nestedName($name)
    {
        if (!is_string($name)) {
            throw new InvalidArgumentException('nestedName name must string.');
        }
        $nestedTypes = $this->nestedTypes($name);

        if ($nestedTypes === false) {
            return $name;
        }
        return mb_substr($name, 0, mb_strlen($name) - mb_strlen($nestedTypes[count($nestedTypes) - 1]));
    }