Sets the base RDN of the distinguished name.

@param string|DistinguishedName $base

@return DistinguishedName
172722
public function setBase($base)
    {
        // Typecast base to string in case we've been given
        // an instance of the distinguished name object.
        $base = (string) $base;

        // If the base DN isn't null we'll try to explode it.
        $base = Utilities::explodeDn($base, false) ?: [];

        // Remove the count key from the exploded distinguished name.
        unset($base['count']);

        foreach ($base as $key => $rdn) {
            // We'll break the RDN into pieces
            $pieces = explode('=', $rdn) ?: [];

            // If there's exactly 2 pieces, then we can work with it.
            if (count($pieces) === 2) {
                $attribute = ucfirst(strtolower($pieces[0]));

                $method = 'add'.$attribute;

                if (method_exists($this, $method)) {
                    // We see what type of RDN it is and add each accordingly.
                    call_user_func_array([$this, $method], [$pieces[1]]);
                }
            }
        }

        return $this;
    }
844531
public function setName($name)
    {
        if ((strlen($name) > 50)) {
            throw new \InvalidArgumentException('invalid length for $name when calling PostCharactersCharacterIdFittingsFitting., must be smaller than or equal to 50.');
        }
        if ((strlen($name) < 1)) {
            throw new \InvalidArgumentException('invalid length for $name when calling PostCharactersCharacterIdFittingsFitting., must be bigger than or equal to 1.');
        }

        $this->container['name'] = $name;

        return $this;
    }
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;
    }
75825
public function setXmlBase($xmlBase = '')
    {
        if (is_string($xmlBase) && (empty($xmlBase) || Format::isUri($xmlBase))) {
            $this->xmlBase = $xmlBase;
        } else {
            $msg = "The 'base' argument must be an empty string or a valid URI, '" . $xmlBase . "' given";
            throw new InvalidArgumentException($msg);
        }
    }
128489
public function rebase(string $base = null): self
    {
        $this->content = data_get($this->getOriginalContent(), $base);

        return $this;
    }
265118
public function setUsername(string $username): void
	{
		if (Strings::match($username, '/[^A-Za-z0-9_]/')) {
			throw new InvalidArgumentException('Username contains invalid characters');
		}

		/* @var $repository UsersRepository */
		$repository = $this->getRepository();
		$user = $repository->getByUsername($username);
		if ($user !== null && $user !== $this) {
			throw new UniqueConstraintViolationException("Username '$username' exists");
		}
		$this->username = $username;
	}
1129903
public function setValid(string $valid)
    {
        if ($this->valid) {
            $this->valid .= '|'.$valid;
        } else {
            $this->valid = $valid;
        }

        return $this;
    }
813714
public static function random_id($base='random') {
        static $counter = 0;
        static $uniq;

        if (!isset($uniq)) {
            $uniq = uniqid();
        }

        $counter++;
        return $base.$uniq.$counter;
    }
800803
public function setLicenseshortname($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->licenseshortname !== $v) {
            $this->licenseshortname = $v;
            $this->modifiedColumns[MediaTableMap::COL_LICENSESHORTNAME] = true;
        }

        return $this;
    }
360728
protected function resolveBaseName()
    {
        $schema = $this->schema();
        $host = str_replace('//', '/', $this->host() . $this->dir . '/');

        return $schema . '://' . $host;
    }
368625
public function setDn($dn = null)
    {
        $this->dn = $dn instanceof Model ? $dn->getDn() : $dn;

        return $this;
    }
390537
public function setBaseURL($urlString)
    {
        if (!is_string($urlString) && !is_null($urlString)) {
            throw new InvalidArgumentException("Please provide a string as parameter!");
        } else {
            $this->base_url = $urlString;
        }

        return $this;
    }
69808
public function numeric(int $base = 10): string
    {
        if ($base < 2 || $base > 36) {
            throw new \InvalidArgumentException('Base must be between 2 and 36 (included)');
        }

        $value = gmp_strval($this->ip, $base);

        // fix for newer versions of GMP (> 5.0) in PHP 5.4+ that removes
        // the leading 0 in base 2
        if ($base == 2) {
            $value = str_pad($value, static::NB_BITS, '0', STR_PAD_LEFT);
        }

        return $value;
    }
649967
public function setName($name)
    {
        $this->name = $name;
        $this->alias = $name . '.phar';
        $this->filePhar = $this->files->combine($this->pathBase, $this->alias);
        $this->fileBat = $this->files->combine($this->pathBase, $name . '.bat');
    }
527610
public function setName($name) {
    $this->reflection = NULL;
    $this->name = trim($name, '\\');
    return $this;
  }
851856
public function setFilename($filename = null)
    {
        $this->filename = $filename;

        $sub_dir = '';
        $sub_dir .= substr($filename, 0, 2).DIRECTORY_SEPARATOR;
        $sub_dir .= substr($filename, 2, 2).DIRECTORY_SEPARATOR;
        $sub_dir .= substr($filename, 4, 2);

        $this->setSubDir($sub_dir);
        $this->setPath($sub_dir.DIRECTORY_SEPARATOR.$filename);

        return $this;
    }
706481
public function setDomainname(string $domainname)
    {
        $this->domainname = $domainname;

        $this->raw = array_merge($this->raw, ['Domainname' => $domainname]);

        return $this;
    }