php/mixins/IconElement.php
public function setIcon( $icon = null ) {
		if ( $this->iconName !== null ) {
			$this->icon->removeClasses( [ 'oo-ui-icon-' . $this->iconName ] );
		}
		if ( $icon !== null ) {
			$this->icon->addClasses( [ 'oo-ui-icon-' . $icon ] );
		}

		$this->iconName = $icon;
		$this->toggleClasses( [ 'oo-ui-iconElement' ], (bool)$this->iconName );
		$this->icon->toggleClasses( [ 'oo-ui-iconElement-noIcon' ], !$this->iconName );

		return $this;
	}
public function setIcon( $icon = null ) {
		if ( $this->iconName !== null ) {
			$this->icon->removeClasses( [ 'oo-ui-icon-' . $this->iconName ] );
		}
		if ( $icon !== null ) {
			$this->icon->addClasses( [ 'oo-ui-icon-' . $icon ] );
		}

		$this->iconName = $icon;
		$this->toggleClasses( [ 'oo-ui-iconElement' ], (bool)$this->iconName );
		$this->icon->toggleClasses( [ 'oo-ui-iconElement-noIcon' ], !$this->iconName );

		return $this;
	}
public function setIcon ( $ icon = null ) { if ( $ this -> iconName !== null ) { $ this -> icon -> removeClasses ( [ 'oo-ui-icon-' . $ this -> iconName ] ) ; } if ( $ icon !== null ) { $ this -> icon -> addClasses ( [ 'oo-ui-icon-' . $ icon ] ) ; } $ this -> iconName = $ icon ; $ this -> toggleClasses ( [ 'oo-ui-iconElement' ] , ( bool ) $ this -> iconName ) ; $ this -> icon -> toggleClasses ( [ 'oo-ui-iconElement-noIcon' ] , ! $ this -> iconName ) ; return $ this ; }
Set icon name.

@param string|null $icon Symbolic icon name
@return $this
Set icon name .