Set avatar

@param string $avatar
@return \User\Model\User\Structure
4891
public function setAvatar( $avatar )
    {
        if ( $this->avatar == $avatar )
        {
            return $this;
        }

        $this->removeFile( $this->avatar );
        $this->avatar = $this->addFile( $avatar, 'users/avatar.%s.%s' );

        return $this;
    }
505476
public function setEnvironment($environment = '')
    {
        // Set the application environment
        $environment = ($environment ?: strtolower(getenv('APPLICATION_ENV')));
        $environment = ($environment ?: 'default');

        // Set the application environment
        $this->set('env', $environment);

        return $this;
    }
164009
def Avatar(self, Id=1, Set=None):
        
        from warnings import warn
        warn('Settings.Avatar: Use Settings.LoadAvatarFromFile instead.', DeprecationWarning, stacklevel=2)
        if Set is None:
            raise TypeError('Argument \'Set\' is mandatory!')
        self.LoadAvatarFromFile(Set, Id)
1137009
public function setIdentity($identity = null)
    {
        if (null === $identity) {
            $this->setResult();
        }

        $this->setParam('identity', $identity);

        return $this;
    }
1071833
protected function setEnvironment($environment)
    {
        $subdirs = [''];
        if (null !== $environment) {
            $subdirs = array_merge($subdirs, preg_split('/[\/\\\]/',
                trim($environment, '/\\'), 0, \PREG_SPLIT_NO_EMPTY));
        }
        $this->sub_dirs = $subdirs;

        return $this;
    }
771151
def users_reset_avatar(self, user_id=None, username=None, **kwargs):
        """"""
        if user_id:
            return self.__call_api_post('users.resetAvatar', userId=user_id, kwargs=kwargs)
        elif username:
            return self.__call_api_post('users.resetAvatar', username=username, kwargs=kwargs)
        else:
            raise RocketMissingParamException('userID or username required')
812635
public function setInstitution($institution)
    {
        if (
                !is_string($institution)
             && !is_null($institution)
        ) {
            throw new \InvalidArgumentException(
                __CLASS__ . ' ' . __METHOD__ . ': Not a string'
            );
        }

        $this->institution = $institution;

        return $this;
    }
529234
public function setOptions($a) {
		foreach ($a as $k=>$v) {
			$this->settings[$k] = $v;
		}
		return $this;
	}
1351108
public function flatten(&$image){

        if($image->isAnimated()) {
            $old = $image->getCore();
            $gift = new GifHelper();
            $hex  = $gift->encode($image->getBlocks());
            $gd   = imagecreatefromstring(pack('H*', $hex)); // Recreate resource from blocks

            imagedestroy( $old ); // Free resource
            $image = new Image(
                $gd,
                $image->getImageFile(),
                $image->getWidth(),
                $image->getHeight(),
                $image->getType(),
                '', // blocks
                false // animated
            );
        }
        return $this;
    }
690508
public void setAvatar(final Link newavatar) {
        final Link old = getAvatar();
        if (old != null) {
            getOtherLinks().remove(old);
        }
        newavatar.setRel("avatar");
        getOtherLinks().add(newavatar);
    }
1094791
public function setMember($member)
    {
        $member = is_string($member) ? [$member] : $member;
        $this->setParameter('MemberToDel_Account', $member);
        return $this;
    }
1118628
public function setFileAvatar($file_avatar){
        if(!$this->setModified('file_avatar', $file_avatar)->isModified()){
            return $this;
        }
        $this->file_avatar = $file_avatar;
        return $this;
    }
1016194
public function setBody($body) {
    if (is_array($body) || is_object($body))
      $this->body = (object) $body;
    else
      $this->body = $body;
    return $this;
  }
938852
public function setGender($gender)
    {
        $gender = strtolower($gender);

        if (in_array($gender, ['male', 'female'])) {
            $this->setObject('gender', $gender);
        }

        return $this;
    }
242969
public function setProfile($profile) {
		if (is_string($profile)) {
			$profile = new Profile($profile);
		}
		$this->profile = $profile;
		return $this;
	}
173576
public function setSubject($subject)
	{
		$this->getComposer()->subject = $subject;
		$this->getComposer()->subjectCharset = CHARSET;

		return $this;
	}
377596
public function setUser(string $user)
    {
        $this->user = $user;

        $this->raw = array_merge($this->raw, ['User' => $user]);

        return $this;
    }