Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
OpenSpout\Writer\XLSX\Manager\Style\StyleManager Class Reference
Inheritance diagram for OpenSpout\Writer\XLSX\Manager\Style\StyleManager:
OpenSpout\Writer\Common\Manager\Style\AbstractStyleManager OpenSpout\Writer\Common\Manager\Style\StyleManagerInterface

Public Member Functions

 __construct (StyleRegistry $styleRegistry, XLSXEscaper $stringsEscaper)
 
 applyExtraStylesIfNeeded (Cell $cell)
 Apply additional styles if the given row needs it.
 
 getStylesXMLFileContent ()
 Returns the content of the "styles.xml" file, given a list of styles.
 
 registerStyle (Style $style)
 Registers the given style as a used style.
 
 shouldApplyStyleOnEmptyCell (?int $styleId)
 For empty cells, we can specify a style or not.
 

Protected Member Functions

 getDefaultStyle ()
 Returns the default style.
 

Protected Attributes

AbstractStyleRegistry AbstractStyleRegistry $styleRegistry
 Registry for all used styles.
 

Member Function Documentation

◆ applyExtraStylesIfNeeded()

OpenSpout\Writer\Common\Manager\Style\AbstractStyleManager::applyExtraStylesIfNeeded ( Cell $cell)
finalinherited

Apply additional styles if the given row needs it.

Typically, set "wrap text" if a cell contains a new line.

Return values
PossiblyUpdatedStyleThe eventually updated style

Implements OpenSpout\Writer\Common\Manager\Style\StyleManagerInterface.

◆ getDefaultStyle()

OpenSpout\Writer\Common\Manager\Style\AbstractStyleManager::getDefaultStyle ( )
finalprotectedinherited

Returns the default style.

Return values
StyleDefault style

◆ registerStyle()

OpenSpout\Writer\Common\Manager\Style\AbstractStyleManager::registerStyle ( Style $style)
finalinherited

Registers the given style as a used style.

Duplicate styles won't be registered more than once.

Parameters
Style$styleThe style to be registered
Return values
Stylethe registered style, updated with an internal ID

Implements OpenSpout\Writer\Common\Manager\Style\StyleManagerInterface.

◆ shouldApplyStyleOnEmptyCell()

OpenSpout\Writer\XLSX\Manager\Style\StyleManager::shouldApplyStyleOnEmptyCell ( ?int $styleId)

For empty cells, we can specify a style or not.

If no style are specified, then the software default will be applied. But sometimes, it may be useful to override this default style, for instance if the cell should have a background color different than the default one or some borders (fonts property don't really matter here).

Return values
boolWhether the cell should define a custom style

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