ListItem extends AbstractElement
List item element.
Table of Contents
- $collectionRelation : bool
- Is part of collection; true for Title, Footnote, Endnote, Chart, and Comment.
- $commentRangeEnd : Comment
- The end position for the linked comment.
- $commentRangeStart : Comment
- The start position for the linked comment.
- $docPart : string
- Document part type: Section|Header|Footer|Footnote|Endnote.
- $docPartId : int
- Document part Id.
- $elementId : string
- Unique Id for element.
- $elementIndex : int
- Index of element in the elements collection (start with 1).
- $mediaRelation : bool
- Has media relation flag; true for Link, Image, and Object.
- $phpWord : PhpWord
- PhpWord object.
- $relationId : int
- Relation Id.
- $sectionId : int
- Section Id.
- $depth : int
- Depth.
- $nestedLevel : int
- Depth of table container nested level; Primarily used for RTF writer/reader.
- $parent : null|AbstractElement
- A reference to the parent.
- $parentContainer : string
- Parent container type.
- $style : ListItem
- Element style.
- $textObject : Text
- Text object.
- $trackChange : TrackChange
- changed element info.
- __construct() : mixed
- Create a new ListItem.
- getCommentRangeEnd() : Comment
- Get comment end.
- getCommentRangeStart() : Comment
- Get comment start.
- getDepth() : int
- Get depth.
- getDocPart() : string
- Get doc part.
- getDocPartId() : int
- Get doc part Id.
- getElementId() : string
- Get element unique ID.
- getElementIndex() : int
- Get element index.
- getNestedLevel() : int
- Get nested level.
- getParent() : null|AbstractElement
- Get parent element.
- getPhpWord() : PhpWord
- Get PhpWord.
- getRelationId() : int
- Get relation Id.
- getSectionId() : int
- Get section number.
- getStyle() : ListItem
- Get style.
- getText() : string
- Get text.
- getTextObject() : Text
- Get Text object.
- getTrackChange() : TrackChange
- Gets the trackChange information.
- isInSection() : bool
- Check if element is located in Section doc part (as opposed to Header/Footer).
- setChangeInfo() : void
- Set changed.
- setCommentRangeEnd() : void
- Set comment end.
- setCommentRangeStart() : void
- Set comment start.
- setDocPart() : void
- Set doc part.
- setElementId() : void
- Set element unique ID from 6 first digit of md5.
- setElementIndex() : void
- Set element index.
- setParentContainer() : void
- Set parent container.
- setPhpWord() : void
- Set PhpWord as reference.
- setRelationId() : void
- Set relation Id.
- setTrackChange() : void
- Sets the trackChange information.
- setEnumVal() : null|string
- Set enum value.
- setNewStyle() : mixed
- Set new style value.
- getMediaPart() : string
- Return media element (image, object, link) container name.
- setCollectionRelation() : void
- Set relation Id for elements that will be registered in the Collection subnamespaces.
- setMediaRelation() : void
- Set relation Id for media elements (link, image, object; legacy of OOXML).
Properties
$collectionRelation
Is part of collection; true for Title, Footnote, Endnote, Chart, and Comment.
protected
bool
$collectionRelation
= false
$commentRangeEnd
The end position for the linked comment.
protected
Comment
$commentRangeEnd
$commentRangeStart
The start position for the linked comment.
protected
Comment
$commentRangeStart
$docPart
Document part type: Section|Header|Footer|Footnote|Endnote.
protected
string
$docPart
= 'Section'
Used by textrun and cell container to determine where the element is located because it will affect the availability of other element, e.g. footnote will not be available when $docPart is header or footer.
$docPartId
Document part Id.
protected
int
$docPartId
= 1
For header and footer, this will be = ($sectionId - 1) * 3 + $index because the max number of header/footer in every page is 3, i.e. AUTO, FIRST, and EVEN (AUTO = ODD)
$elementId
Unique Id for element.
protected
string
$elementId
$elementIndex
Index of element in the elements collection (start with 1).
protected
int
$elementIndex
= 1
$mediaRelation
Has media relation flag; true for Link, Image, and Object.
protected
bool
$mediaRelation
= false
$phpWord
PhpWord object.
protected
PhpWord
$phpWord
$relationId
Relation Id.
protected
int
$relationId
$sectionId
Section Id.
protected
int
$sectionId
$depth
Depth.
private
int
$depth
$nestedLevel
Depth of table container nested level; Primarily used for RTF writer/reader.
private
int
$nestedLevel
= 0
0 = Not in a table; 1 = in a table; 2 = in a table inside another table, etc.
$parent
A reference to the parent.
private
null|AbstractElement
$parent
$parentContainer
Parent container type.
private
string
$parentContainer
$style
Element style.
private
ListItem
$style
$textObject
Text object.
private
Text
$textObject
$trackChange
changed element info.
private
TrackChange
$trackChange
Methods
__construct()
Create a new ListItem.
public
__construct(string $text, int $depth[, mixed $fontStyle = null ][, null|array<string|int, mixed>|string $listStyle = null ][, mixed $paragraphStyle = null ]) : mixed
Parameters
- $text : string
- $depth : int
- $fontStyle : mixed = null
- $listStyle : null|array<string|int, mixed>|string = null
- $paragraphStyle : mixed = null
Return values
mixed —getCommentRangeEnd()
Get comment end.
public
getCommentRangeEnd() : Comment
Return values
Comment —getCommentRangeStart()
Get comment start.
public
getCommentRangeStart() : Comment
Return values
Comment —getDepth()
Get depth.
public
getDepth() : int
Return values
int —getDocPart()
Get doc part.
public
getDocPart() : string
Return values
string —getDocPartId()
Get doc part Id.
public
getDocPartId() : int
Return values
int —getElementId()
Get element unique ID.
public
getElementId() : string
Return values
string —getElementIndex()
Get element index.
public
getElementIndex() : int
Return values
int —getNestedLevel()
Get nested level.
public
getNestedLevel() : int
Return values
int —getParent()
Get parent element.
public
getParent() : null|AbstractElement
Return values
null|AbstractElement —getPhpWord()
Get PhpWord.
public
getPhpWord() : PhpWord
Return values
PhpWord —getRelationId()
Get relation Id.
public
getRelationId() : int
Return values
int —getSectionId()
Get section number.
public
getSectionId() : int
Return values
int —getStyle()
Get style.
public
getStyle() : ListItem
Return values
ListItem —getText()
Get text.
public
getText() : string
Tags
Return values
string —getTextObject()
Get Text object.
public
getTextObject() : Text
Return values
Text —getTrackChange()
Gets the trackChange information.
public
getTrackChange() : TrackChange
Return values
TrackChange —isInSection()
Check if element is located in Section doc part (as opposed to Header/Footer).
public
isInSection() : bool
Return values
bool —setChangeInfo()
Set changed.
public
setChangeInfo(string $type, string $author[, null|DateTime|int $date = null ]) : void
Parameters
- $type : string
-
INSERTED|DELETED
- $author : string
- $date : null|DateTime|int = null
-
allways in UTC
Return values
void —setCommentRangeEnd()
Set comment end.
public
setCommentRangeEnd(Comment $value) : void
Parameters
- $value : Comment
Return values
void —setCommentRangeStart()
Set comment start.
public
setCommentRangeStart(Comment $value) : void
Parameters
- $value : Comment
Return values
void —setDocPart()
Set doc part.
public
setDocPart(string $docPart[, int $docPartId = 1 ]) : void
Parameters
- $docPart : string
- $docPartId : int = 1
Return values
void —setElementId()
Set element unique ID from 6 first digit of md5.
public
setElementId() : void
Return values
void —setElementIndex()
Set element index.
public
setElementIndex(int $value) : void
Parameters
- $value : int
Return values
void —setParentContainer()
Set parent container.
public
setParentContainer(AbstractElement $container) : void
Passed parameter should be a container, except for Table (contain Row) and Row (contain Cell)
Parameters
- $container : AbstractElement
Return values
void —setPhpWord()
Set PhpWord as reference.
public
setPhpWord([PhpWord $phpWord = null ]) : void
Parameters
- $phpWord : PhpWord = null
Return values
void —setRelationId()
Set relation Id.
public
setRelationId(int $value) : void
Parameters
- $value : int
Return values
void —setTrackChange()
Sets the trackChange information.
public
setTrackChange(TrackChange $trackChange) : void
Parameters
- $trackChange : TrackChange
Return values
void —setEnumVal()
Set enum value.
protected
setEnumVal([null|string $value = null ][, array<string|int, string> $enum = [] ][, null|string $default = null ]) : null|string
Parameters
- $value : null|string = null
- $enum : array<string|int, string> = []
- $default : null|string = null
Tags
Return values
null|string —setNewStyle()
Set new style value.
protected
setNewStyle(mixed $styleObject[, mixed $styleValue = null ][, bool $returnObject = false ]) : mixed
Parameters
- $styleObject : mixed
-
Style object
- $styleValue : mixed = null
-
Style value
- $returnObject : bool = false
-
Always return object
Return values
mixed —getMediaPart()
Return media element (image, object, link) container name.
private
getMediaPart() : string
Return values
string —section|headerx|footerx|footnote|endnote
setCollectionRelation()
Set relation Id for elements that will be registered in the Collection subnamespaces.
private
setCollectionRelation() : void
Return values
void —setMediaRelation()
Set relation Id for media elements (link, image, object; legacy of OOXML).
private
setMediaRelation() : void
- Image element needs to be passed to Media object
- Icon needs to be set for Object element