PHP Class Box\Spout\Writer\Common\Helper\AbstractStyleHelper

Afficher le fichier Open project: box/spout Class Usage Examples

Protected Properties

Свойство Type Description
$serializedStyleToStyleIdMappingTable [SERIALIZED_STYLE] => [STYLE_ID] mapping table, keeping track of the registered styles
$styleIdToStyleMappingTable [STYLE_ID] => [STYLE] mapping table, keeping track of the registered styles

Méthodes publiques

Méthode Description
__construct ( Style $defaultStyle )
applyExtraStylesIfNeeded ( Style $style, array $dataRow ) : Style Apply additional styles if the given row needs it.
registerStyle ( Style $style ) : Style Registers the given style as a used style.

Méthodes protégées

Méthode Description
applyWrapTextIfCellContainsNewLine ( Style $style, array $dataRow ) : Style Set the "wrap text" option if a cell of the given row contains a new line.
getDefaultStyle ( ) : Style Returns the default style
getRegisteredStyles ( ) : Style[]
getStyleFromSerializedStyle ( string $serializedStyle ) : Style Returns the registered style associated to the given serialization.
hasStyleAlreadyBeenRegistered ( Style $style ) : boolean Returns whether the given style has already been registered.

Method Details

__construct() public méthode

public __construct ( Style $defaultStyle )
$defaultStyle Box\Spout\Writer\Style\Style

applyExtraStylesIfNeeded() public méthode

Typically, set "wrap text" if a cell contains a new line.
public applyExtraStylesIfNeeded ( Style $style, array $dataRow ) : Style
$style Box\Spout\Writer\Style\Style The original style
$dataRow array The row the style will be applied to
Résultat Box\Spout\Writer\Style\Style The updated style

applyWrapTextIfCellContainsNewLine() protected méthode

Set the "wrap text" option if a cell of the given row contains a new line.
protected applyWrapTextIfCellContainsNewLine ( Style $style, array $dataRow ) : Style
$style Box\Spout\Writer\Style\Style The original style
$dataRow array The row the style will be applied to
Résultat Box\Spout\Writer\Style\Style The eventually updated style

getDefaultStyle() protected méthode

Returns the default style
protected getDefaultStyle ( ) : Style
Résultat Box\Spout\Writer\Style\Style Default style

getRegisteredStyles() protected méthode

protected getRegisteredStyles ( ) : Style[]
Résultat Box\Spout\Writer\Style\Style[] List of registered styles

getStyleFromSerializedStyle() protected méthode

Returns the registered style associated to the given serialization.
protected getStyleFromSerializedStyle ( string $serializedStyle ) : Style
$serializedStyle string The serialized style from which the actual style should be fetched from
Résultat Box\Spout\Writer\Style\Style

hasStyleAlreadyBeenRegistered() protected méthode

Returns whether the given style has already been registered.
protected hasStyleAlreadyBeenRegistered ( Style $style ) : boolean
$style Box\Spout\Writer\Style\Style
Résultat boolean

registerStyle() public méthode

Duplicate styles won't be registered more than once.
public registerStyle ( Style $style ) : Style
$style Box\Spout\Writer\Style\Style The style to be registered
Résultat Box\Spout\Writer\Style\Style The registered style, updated with an internal ID.

Property Details

$serializedStyleToStyleIdMappingTable protected_oe property

[SERIALIZED_STYLE] => [STYLE_ID] mapping table, keeping track of the registered styles
protected $serializedStyleToStyleIdMappingTable

$styleIdToStyleMappingTable protected_oe property

[STYLE_ID] => [STYLE] mapping table, keeping track of the registered styles
protected $styleIdToStyleMappingTable