DocPropsCustom
extends AbstractPart
in package
Custom properties reader.
Tags
Table of Contents
Constants
- READ_EQUAL = 'attributeEquals'
- READ_FALSE = 'attributeFalse'
- READ_SIZE = 'attributeMultiplyByTwo'
- READ_TRUE = 'attributeTrue'
- READ_VALUE = 'attributeValue'
- Conversion method.
Properties
- $commentRefs : array<string, array<string, AbstractElement>>
- Comment references.
- $docFile : string
- Document file.
- $imageLoading : bool
- Image Loading.
- $rels : array<string|int, mixed>
- Part relationships.
- $xmlFile : string
- XML file.
Methods
- __construct() : mixed
- Create new instance.
- getCommentReferences() : array<string, array<string, null|AbstractElement>>
- Get comment references.
- hasImageLoading() : bool
- read() : void
- Read custom document properties.
- setCommentReferences() : self
- Set comment references.
- setImageLoading() : self
- setRels() : void
- Set relationships.
- getCommentReference() : array<string, null|AbstractElement>
- Get comment reference.
- readFontStyle() : null|array<string|int, mixed>
- Read w:rPr.
- readParagraph() : void
- Read w:p.
- readParagraphStyle() : null|array<string|int, mixed>
- Read w:pPr.
- readRun() : void
- Read w:r.
- readRunChild() : void
- Parses nodes under w:r.
- readStyleDefs() : array<string|int, mixed>
- Read style definition.
- readTable() : void
- Read w:tbl.
- readTableStyle() : null|array<string|int, mixed>|string
- Read w:tblPr.
- findPossibleAttribute() : null|string
- Returns the first attribute found.
- findPossibleElement() : null|string
- Returns the first child element found.
- getHeadingDepth() : null|number
- Returns the depth of the Heading, returns 0 for a Title.
- getMediaTarget() : null|string
- Returns the target of image, object, or link as stored in ::readMainRels.
- getTargetMode() : null|string
- Returns the target mode.
- isOn() : bool
- Parses the value of the on/off value, null is considered true as it means the w:val attribute was not present.
- readCellStyle() : null|array<string|int, mixed>
- Read w:tcPr.
- readFormField() : void
- readStyleDef() : mixed
- Return style definition based on conversion method.
- readTableIndent() : TblWidth
- Read w:tblInd.
- readTablePosition() : array<string|int, mixed>
- Read w:tblpPr.
- setCommentReference() : self
- Set comment reference.
Constants
READ_EQUAL
public
mixed
READ_EQUAL
= 'attributeEquals'
READ_FALSE
public
mixed
READ_FALSE
= 'attributeFalse'
READ_SIZE
public
mixed
READ_SIZE
= 'attributeMultiplyByTwo'
READ_TRUE
public
mixed
READ_TRUE
= 'attributeTrue'
READ_VALUE
Conversion method.
public
mixed
READ_VALUE
= 'attributeValue'
Tags
Properties
$commentRefs
Comment references.
protected
array<string, array<string, AbstractElement>>
$commentRefs
= []
$docFile
Document file.
protected
string
$docFile
$imageLoading
Image Loading.
protected
bool
$imageLoading
= true
$rels
Part relationships.
protected
array<string|int, mixed>
$rels
= []
$xmlFile
XML file.
protected
string
$xmlFile
Methods
__construct()
Create new instance.
public
__construct(string $docFile, string $xmlFile) : mixed
Parameters
- $docFile : string
- $xmlFile : string
getCommentReferences()
Get comment references.
public
getCommentReferences() : array<string, array<string, null|AbstractElement>>
Return values
array<string, array<string, null|AbstractElement>>hasImageLoading()
public
hasImageLoading() : bool
Return values
boolread()
Read custom document properties.
public
read(PhpWord $phpWord) : void
Parameters
- $phpWord : PhpWord
setCommentReferences()
Set comment references.
public
setCommentReferences(array<string, array<string, null|AbstractElement>> $commentRefs) : self
Parameters
- $commentRefs : array<string, array<string, null|AbstractElement>>
Return values
selfsetImageLoading()
public
setImageLoading(bool $value) : self
Parameters
- $value : bool
Return values
selfsetRels()
Set relationships.
public
setRels(array<string|int, mixed> $value) : void
Parameters
- $value : array<string|int, mixed>
getCommentReference()
Get comment reference.
protected
getCommentReference(string $id) : array<string, null|AbstractElement>
Parameters
- $id : string
Return values
array<string, null|AbstractElement>readFontStyle()
Read w:rPr.
protected
readFontStyle(XMLReader $xmlReader, DOMElement $domNode) : null|array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
null|array<string|int, mixed>readParagraph()
Read w:p.
protected
readParagraph(XMLReader $xmlReader, DOMElement $domNode, AbstractContainer $parent[, string $docPart = 'document' ]) : void
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
- $parent : AbstractContainer
- $docPart : string = 'document'
Tags
readParagraphStyle()
Read w:pPr.
protected
readParagraphStyle(XMLReader $xmlReader, DOMElement $domNode) : null|array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
null|array<string|int, mixed>readRun()
Read w:r.
protected
readRun(XMLReader $xmlReader, DOMElement $domNode, AbstractContainer $parent, string $docPart[, mixed $paragraphStyle = null ]) : void
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
- $parent : AbstractContainer
- $docPart : string
- $paragraphStyle : mixed = null
Tags
readRunChild()
Parses nodes under w:r.
protected
readRunChild(XMLReader $xmlReader, DOMElement $node, AbstractContainer $parent, string $docPart[, mixed $paragraphStyle = null ][, mixed $fontStyle = null ]) : void
Parameters
- $xmlReader : XMLReader
- $node : DOMElement
- $parent : AbstractContainer
- $docPart : string
- $paragraphStyle : mixed = null
- $fontStyle : mixed = null
readStyleDefs()
Read style definition.
protected
readStyleDefs(XMLReader $xmlReader[, DOMElement|null $parentNode = null ][, array<string|int, mixed> $styleDefs = [] ]) : array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $parentNode : DOMElement|null = null
- $styleDefs : array<string|int, mixed> = []
Tags
Return values
array<string|int, mixed>readTable()
Read w:tbl.
protected
readTable(XMLReader $xmlReader, DOMElement $domNode, mixed $parent[, string $docPart = 'document' ]) : void
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
- $parent : mixed
- $docPart : string = 'document'
readTableStyle()
Read w:tblPr.
protected
readTableStyle(XMLReader $xmlReader, DOMElement $domNode) : null|array<string|int, mixed>|string
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Tags
Return values
null|array<string|int, mixed>|stringfindPossibleAttribute()
Returns the first attribute found.
private
findPossibleAttribute(XMLReader $xmlReader, DOMElement $node, array<string|int, mixed>|string $attributes) : null|string
Parameters
- $xmlReader : XMLReader
- $node : DOMElement
- $attributes : array<string|int, mixed>|string
Return values
null|stringfindPossibleElement()
Returns the first child element found.
private
findPossibleElement(XMLReader $xmlReader[, DOMElement|null $parentNode = null ][, null|array<string|int, mixed>|string $elements = null ]) : null|string
Parameters
- $xmlReader : XMLReader
- $parentNode : DOMElement|null = null
- $elements : null|array<string|int, mixed>|string = null
Return values
null|stringgetHeadingDepth()
Returns the depth of the Heading, returns 0 for a Title.
private
getHeadingDepth([array<string|int, mixed>|null $paragraphStyle = null ]) : null|number
Parameters
- $paragraphStyle : array<string|int, mixed>|null = null
Return values
null|numbergetMediaTarget()
Returns the target of image, object, or link as stored in ::readMainRels.
private
getMediaTarget(string $docPart, string $rId) : null|string
Parameters
- $docPart : string
- $rId : string
Return values
null|stringgetTargetMode()
Returns the target mode.
private
getTargetMode(string $docPart, string $rId) : null|string
Parameters
- $docPart : string
- $rId : string
Return values
null|stringisOn()
Parses the value of the on/off value, null is considered true as it means the w:val attribute was not present.
private
isOn([string $value = null ]) : bool
Parameters
- $value : string = null
Tags
Return values
boolreadCellStyle()
Read w:tcPr.
private
readCellStyle(XMLReader $xmlReader, DOMElement $domNode) : null|array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
null|array<string|int, mixed>readFormField()
private
readFormField(XMLReader $xmlReader, array<string|int, DOMElement> $domNodes, AbstractContainer $parent, mixed $paragraphStyle, string $formType) : void
Parameters
- $xmlReader : XMLReader
- $domNodes : array<string|int, DOMElement>
- $parent : AbstractContainer
- $paragraphStyle : mixed
- $formType : string
readStyleDef()
Return style definition based on conversion method.
private
readStyleDef(string $method, null|string $attributeValue, mixed $expected) : mixed
Parameters
- $method : string
- $attributeValue : null|string
- $expected : mixed
Tags
readTableIndent()
Read w:tblInd.
private
readTableIndent(XMLReader $xmlReader, DOMElement $domNode) : TblWidth
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
TblWidthreadTablePosition()
Read w:tblpPr.
private
readTablePosition(XMLReader $xmlReader, DOMElement $domNode) : array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
array<string|int, mixed>setCommentReference()
Set comment reference.
private
setCommentReference(string $type, string $id, AbstractElement $element) : self
Parameters
- $type : string
- $id : string
- $element : AbstractElement