PHP Класс Box\Spout\Writer\Common\Helper\AbstractStyleHelper

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный Метод

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

applyExtraStylesIfNeeded() публичный Метод

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
Результат Box\Spout\Writer\Style\Style The updated style

applyWrapTextIfCellContainsNewLine() защищенный Метод

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
Результат Box\Spout\Writer\Style\Style The eventually updated style

getDefaultStyle() защищенный Метод

Returns the default style
protected getDefaultStyle ( ) : Style
Результат Box\Spout\Writer\Style\Style Default style

getRegisteredStyles() защищенный Метод

protected getRegisteredStyles ( ) : Style[]
Результат Box\Spout\Writer\Style\Style[] List of registered styles

getStyleFromSerializedStyle() защищенный Метод

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
Результат Box\Spout\Writer\Style\Style

hasStyleAlreadyBeenRegistered() защищенный Метод

Returns whether the given style has already been registered.
protected hasStyleAlreadyBeenRegistered ( Style $style ) : boolean
$style Box\Spout\Writer\Style\Style
Результат boolean

registerStyle() публичный Метод

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
Результат Box\Spout\Writer\Style\Style The registered style, updated with an internal ID.

Описание свойств

$serializedStyleToStyleIdMappingTable защищенное свойство

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

$styleIdToStyleMappingTable защищенное свойство

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