\PhpOffice\PhpWord\StyleListItem

List item style

Before version 0.10.0, numbering style is defined statically with $listType. After version 0.10.0, numbering style is defined by using Numbering and recorded by $numStyle. $listStyle is maintained for backward compatility

Summary

Methods
Properties
Constants
getStyleName()
setStyleName()
getIndex()
setIndex()
isAuto()
setAuto()
getChildStyleValue()
setStyleValue()
setStyleByArray()
setArrayStyle()
__construct()
getListType()
setListType()
getNumStyle()
setNumStyle()
getNumId()
No public properties found
TYPE_SQUARE_FILLED
TYPE_BULLET_FILLED
TYPE_BULLET_EMPTY
TYPE_NUMBER
TYPE_NUMBER_NESTED
TYPE_ALPHANUM
setNonEmptyVal()
setBoolVal()
setNumericVal()
setIntVal()
setFloatVal()
setEnumVal()
setObjectVal()
setPairedVal()
$styleName
$index
$aliases
N/A
getListTypeStyle()
$isAuto
$listType
$numStyle
$numId
N/A

Constants

TYPE_SQUARE_FILLED

TYPE_SQUARE_FILLED = 1

TYPE_BULLET_FILLED

TYPE_BULLET_FILLED = 3

TYPE_BULLET_EMPTY

TYPE_BULLET_EMPTY = 5

TYPE_NUMBER

TYPE_NUMBER = 7

TYPE_NUMBER_NESTED

TYPE_NUMBER_NESTED = 8

TYPE_ALPHANUM

TYPE_ALPHANUM = 9

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

$listType

$listType : integer

Legacy list type

Type

integer

$numStyle

$numStyle : string

Numbering style name

Type

string

$numId

$numId : integer

Numbering definition instance ID

Type

integer

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

__construct()

__construct(string  $numStyle = null) 

Create new instance

Parameters

string $numStyle

getListType()

getListType() : integer

Get List Type

Returns

integer

setListType()

setListType(integer  $value = self::TYPE_BULLET_FILLED) : self

Set legacy list type for version < 0.10.0

Parameters

integer $value

Returns

self

getNumStyle()

getNumStyle() : string

Get numbering style name

Returns

string

setNumStyle()

setNumStyle(string  $value) : self

Set numbering style name

Parameters

string $value

Returns

self

getNumId()

getNumId() : integer

Get numbering Id

Returns

integer

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

getListTypeStyle()

getListTypeStyle() : array

Get legacy numbering definition

Returns

array