Sets a new last name of the person.

@param string $lastname New last name of the person
972041
public function setLastname($lastname)
	{
		if ( $lastname == $this->getLastname() ) { return; }

		$this->_values['lastname'] = (string) $lastname;
		$this->setModified();
	}
563064
public function setOwner( $userName )
	{
		if( !$userName )
			throw new InvalidArgumentException( 'No User Name given.' );
		if( !file_exists( $this->fileName ) )
			throw new RuntimeException( 'File "'.$this->fileName.'" is not existing' );
#		if( !$this->isOwner() )
#			throw new RuntimeException( 'File "'.$this->fileName.'" is not owned by current user' );
		if( !$this->isWritable( $this->fileName ) )
			throw new RuntimeException( 'File "'.$this->fileName.'" is not writable' );
		if( !@chOwn( $this->fileName, $userName ) )
			throw new RuntimeException( 'Only a superuser can change file owner' );
	}
628721
public function setName($name)
    {
        if (in_array($name, Statistics::asArray())) {
            $this->name = $name;
        } else {
            $msg = "The name argument must be a value from the Statistics enumeration, '" . $name . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
281973
public function rename($username)
    {
        if ($username !== $this->username) {
            $oldUsername = $this->username;
            $this->username = $username;

            $this->raise(new Renamed($this, $oldUsername));
        }

        return $this;
    }
659281
public function setName($name)
    {
        $nameParts = explode(' ', $name);
        $this->Surname = array_pop($nameParts);
        $this->FirstName = join(' ', $nameParts);
    }
377697
public function setFirstName($firstName): Hybrid
    {
        self::validateSetLength('firstName', $firstName);
        $this->data['firstName'] = $firstName;

        return $this;
    }
383328
public function setFromName($fieldName)
    {
        if (empty($this->name)) {
            $this->name = $fieldName;
        }
        $this->attrName = $this->getAttrName();
        $this->concrete = false === empty($this->getColumnName());

        if (empty($this->verboseName)) {
            $this->verboseName = ucwords(
                str_replace(
                    '_',
                    ' ',
                    $this->name
                )
            );
        }
    }
770428
public function setFirstname($firstname)
    {
        if (!is_string($firstname) && !is_null($firstname)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not a string');
        }

        $this->firstname = $firstname;

        return $this;
    }
983361
public function setName($name): void
    {
        if ($this->sessionExists()) {
            throw new SessionException(
                'Cannot set session name after a session has already started'
            );
        }

        if (!preg_match('/^[a-zA-Z0-9]+$/', $name)) {
            throw new SessionException(
                'Name provided contains invalid characters; must be alphanumeric only'
            );
        }

        $this->name = $name;
        session_name($name);
    }
1123982
public function setUsername($username)
    {
        if (mb_strlen($username) == 0) {
            $this->throwError('Username not set');
        }

        $this->username = $username;

        return $this;
    }
1187534
public function setName(string $name = '') : void
    {
        if (empty($name)) {
            throw new RuntimeException('Panel name not found therefore the object cannot be created');
        }
        $this->name = $name;
    }
29750
public function setUser($username)
    {
        $app = App::getInstance();

        try {
            parent::__construct($username);
        } catch (\FelixOnline\Exceptions\ModelNotFoundException $e) {
            User::createUser($username);
            parent::__construct($username);
        }

        $user = new User($username);
        $this->logIn($user);
        $this->user = $user;
    }
47050
public function setDN($username, $nosub = 0)
	{
		if ($this->users_dn == '' || $nosub)
		{
			$this->dn = $username;
		}
		elseif (strlen($username))
		{
			$this->dn = str_replace('[username]', $username, $this->users_dn);
		}
		else
		{
			$this->dn = '';
		}
	}
43260
public function setNames($firstName, $lastName, $fullName)
    {
        $names = [0 => '', 1 => ''];
        if (!empty($fullName)) {
            $this->fullName = trim($fullName);
            $names = preg_split("/[\s]+/", $this->fullName, 2);
        }
        if (!empty($firstName)) {
            $this->firstName = trim($firstName);
            $names[0] = $this->firstName;
        } else if (!empty($names[0])) {
            $this->firstName = $names[0];
        } else {
            $this->firstName = 'User';
        }
        if (!empty($lastName)) {
            $this->lastName = trim($lastName);
            $names[1] = $this->lastName;
        } else if (!empty($names[1])) {
            $this->lastName = $names[1];
        } else {
            $this->lastName = $this->id;
        }
        if (empty($this->fullName)) {
            $this->fullName = "{$this->firstName} {$this->lastName}";
        }
    }
85583
public function setUsername($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->username !== $v) {
            $this->username = $v;
            $this->modifiedColumns[] = UserPeer::USERNAME;
        }


        return $this;
    }
825415
public function validateLastName($lastName)
    {
        if (empty($lastName)) {
            $this->addError('lastName', 'Last name cannot be empty');
            return false;
        }

        if (!is_string($lastName)) {
            $this->addError('lastName', 'Last name must be a string');
            return false;
        }

        if (mb_strlen($lastName, 'UTF-8') > 255) {
            $this->addError('lastName', 'Last name length has to be less or equal to 255');
            return false;
        }

        return true;
    }
13272
public function setName($name)
    {
        $this->validateName($name);

        if (!$this->name) {
            $this->name = $name;
        } elseif ($this->name !== $name) {
            $this->setAliases([$name]);
        }
        return $this;
    }