Properties

$styleName

$styleName : string

Style name

Type

string

$index

$index : integer|null

Index number in Style collection for named style

This number starts from one and defined in Style::setStyleValues()

Type

integer|null

$aliases

$aliases : array

Aliases

Type

array

$isAuto

$isAuto : boolean

Is this an automatic style? (Used primarily in OpenDocument driver)

Type

boolean

Methods

getStyleName()

getStyleName() : string

Get style name

Returns

string

setStyleName()

setStyleName(string  $value) : self

Set style name

Parameters

string $value

Returns

self

getIndex()

getIndex() : integer|null

Get index number

Returns

integer|null

setIndex()

setIndex(integer|null  $value = null) : self

Set index number

Parameters

integer|null $value

Returns

self

isAuto()

isAuto() : boolean

Get is automatic style flag

Returns

boolean

setAuto()

setAuto(boolean  $value = true) : self

Set is automatic style flag

Parameters

boolean $value

Returns

self

getChildStyleValue()

getChildStyleValue(\PhpOffice\PhpWord\Style\AbstractStyle  $substyleObject, string  $substyleProperty) : mixed

Return style value of child style object, e.g. `left` from `Indentation` child style of `Paragraph`

Parameters

\PhpOffice\PhpWord\Style\AbstractStyle $substyleObject
string $substyleProperty

Returns

mixed

setStyleValue()

setStyleValue(string  $key, string  $value) : self

Set style value template method

Some child classes have their own specific overrides. Backward compability check for versions < 0.10.0 which use underscore prefix for their private properties. Check if the set method is exists. Throws an exception?

Parameters

string $key
string $value

Returns

self

setStyleByArray()

setStyleByArray(array  $values = array()) : self

Set style by using associative array

Parameters

array $values

Returns

self

setArrayStyle()

setArrayStyle(array  $style = array()) : self

Set style using associative array

Parameters

array $style

Returns

self

setNonEmptyVal()

setNonEmptyVal(string  $value, string  $default) : string

Set default for null and empty value

Parameters

string $value

(was: mixed)

string $default

(was: mixed)

Returns

string —

(was: mixed)

setBoolVal()

setBoolVal(boolean  $value, boolean  $default) : boolean

Set bool value

Parameters

boolean $value
boolean $default

Returns

boolean

setNumericVal()

setNumericVal(mixed  $value, integer|float|null  $default = null) : integer|float|null

Set numeric value

Parameters

mixed $value
integer|float|null $default

Returns

integer|float|null

setIntVal()

setIntVal(integer|null  $value, integer|null  $default = null) : integer|null

Set integer value: Convert string that contains only numeric into integer

Parameters

integer|null $value
integer|null $default

Returns

integer|null

setFloatVal()

setFloatVal(mixed  $value, float|null  $default = null) : float|null

Set float value: Convert string that contains only numeric into float

Parameters

mixed $value
float|null $default

Returns

float|null

setEnumVal()

setEnumVal(mixed  $value = null, array  $enum = array(), mixed  $default = null) : mixed

Set enum value

Parameters

mixed $value
array $enum
mixed $default

Throws

\InvalidArgumentException

Returns

mixed

setObjectVal()

setObjectVal(mixed  $value, string  $styleName,   $style) : mixed

Set object value

Parameters

mixed $value
string $styleName
$style

Returns

mixed

setPairedVal()

setPairedVal(  $property,   $pairProperty, boolean  $value) : self

Set $property value and set $pairProperty = false when $value = true

Parameters

$property
$pairProperty
boolean $value

Returns

self