Moodle PHP Documentation 4.1
Moodle 4.1.19+ (Build: 20250711) (5f47dc23ffc)
Box\Spout\Writer\Common\Creator\Style\StyleBuilder Class Reference

Public Member Functions

 build ()
 Returns the configured style.
 
 setBackgroundColor ($color)
 Sets a background color.
 
 setBorder (Border $border)
 Set a border.
 
 setCellAlignment ($cellAlignment)
 Sets the cell alignment.
 
 setFontBold ()
 Makes the font bold.
 
 setFontColor ($fontColor)
 Sets the font color.
 
 setFontItalic ()
 Makes the font italic.
 
 setFontName ($fontName)
 Sets the font name.
 
 setFontSize ($fontSize)
 Sets the font size.
 
 setFontStrikethrough ()
 Makes the font struck through.
 
 setFontUnderline ()
 Makes the font underlined.
 
 setFormat ($format)
 Sets a format.
 
 setShouldWrapText ($shouldWrap=true)
 Makes the text wrap in the cell if requested.
 

Protected Attributes

Style $style
 Style to be created.
 

Member Function Documentation

◆ build()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::build ( )

Returns the configured style.

The style is cached and can be reused.

Return values
Style

◆ setBackgroundColor()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setBackgroundColor ( $color)

Sets a background color.

Parameters
string$colorARGB color (
See also
Color)
Return values
StyleBuilder

◆ setBorder()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setBorder ( Border $border)

Set a border.

Parameters
Border$border
Return values
$this

◆ setCellAlignment()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setCellAlignment ( $cellAlignment)

Sets the cell alignment.

Parameters
string$cellAlignmentThe cell alignment
Exceptions
InvalidArgumentExceptionIf the given cell alignment is not valid
Return values
StyleBuilder

◆ setFontBold()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFontBold ( )

Makes the font bold.

Return values
StyleBuilder

◆ setFontColor()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFontColor ( $fontColor)

Sets the font color.

Parameters
string$fontColorARGB color (
See also
Color)
Return values
StyleBuilder

◆ setFontItalic()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFontItalic ( )

Makes the font italic.

Return values
StyleBuilder

◆ setFontName()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFontName ( $fontName)

Sets the font name.

Parameters
string$fontNameName of the font to use
Return values
StyleBuilder

◆ setFontSize()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFontSize ( $fontSize)

Sets the font size.

Parameters
int$fontSizeFont size, in pixels
Return values
StyleBuilder

◆ setFontStrikethrough()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFontStrikethrough ( )

Makes the font struck through.

Return values
StyleBuilder

◆ setFontUnderline()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFontUnderline ( )

Makes the font underlined.

Return values
StyleBuilder

◆ setFormat()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setFormat ( $format)

Sets a format.

Parameters
string$formatFormat
Return values
StyleBuilder@api

◆ setShouldWrapText()

Box\Spout\Writer\Common\Creator\Style\StyleBuilder::setShouldWrapText ( $shouldWrap = true)

Makes the text wrap in the cell if requested.

Parameters
bool$shouldWrapShould the text be wrapped
Return values
StyleBuilder

The documentation for this class was generated from the following file: