Settings extends AbstractPart
Settings reader
Tags
Table of Contents
- READ_EQUAL = 'attributeEquals'
- READ_FALSE = 'attributeFalse'
- READ_SIZE = 'attributeMultiplyByTwo'
- READ_TRUE = 'attributeTrue'
- READ_VALUE = 'attributeValue'
- Conversion method
- $docFile : string
- Document file
- $rels : array<string|int, mixed>
- Part relationships
- $xmlFile : string
- XML file
- $booleanProperties : mixed
- __construct() : mixed
- Create new instance
- read() : mixed
- Read settings.xml.
- setRels() : mixed
- Set relationships.
- readFontStyle() : array<string|int, mixed>|null
- Read w:rPr
- readParagraph() : mixed
- Read w:p.
- readParagraphStyle() : array<string|int, mixed>|null
- Read w:pPr.
- readRun() : mixed
- Read w:r.
- readRunChild() : mixed
- Parses nodes under w:r
- readStyleDefs() : array<string|int, mixed>
- Read style definition
- readTable() : mixed
- Read w:tbl.
- readTableStyle() : string|array<string|int, mixed>|null
- Read w:tblPr
- setConsecutiveHyphenLimit() : mixed
- setDocumentProtection() : mixed
- Sets the document protection
- setHyphenationZone() : mixed
- setProofState() : mixed
- Sets the proof state
- setRevisionView() : mixed
- Set the Revision view
- setThemeFontLang() : mixed
- Sets the document Language
- setZoom() : mixed
- Sets the proof state
- findPossibleAttribute() : string|null
- Returns the first attribute found
- findPossibleElement() : string|null
- Returns the first child element found
- getHeadingDepth() : number|null
- Returns the depth of the Heading, returns 0 for a Title
- getMediaTarget() : string|null
- Returns the target of image, object, or link as stored in ::readMainRels
- getTargetMode() : string|null
- 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() : array<string|int, mixed>
- Read w:tcPr
- readStyleDef() : mixed
- Return style definition based on conversion method
- readTableIndent() : TblWidth
- Read w:tblInd
- readTablePosition() : array<string|int, mixed>
- Read w:tblpPr
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
$docFile
Document file
protected
string
$docFile
$rels
Part relationships
protected
array<string|int, mixed>
$rels
= array()
$xmlFile
XML file
protected
string
$xmlFile
$booleanProperties
private
static mixed
$booleanProperties
= array('mirrorMargins', 'hideSpellingErrors', 'hideGrammaticalErrors', 'trackRevisions', 'doNotTrackMoves', 'doNotTrackFormatting', 'evenAndOddHeaders', 'updateFields', 'autoHyphenation', 'doNotHyphenateCaps')
Methods
__construct()
Create new instance
public
__construct(string $docFile, string $xmlFile) : mixed
Parameters
- $docFile : string
- $xmlFile : string
Return values
mixed —read()
Read settings.xml.
public
read(PhpWord $phpWord) : mixed
Parameters
- $phpWord : PhpWord
Return values
mixed —setRels()
Set relationships.
public
setRels(array<string|int, mixed> $value) : mixed
Parameters
- $value : array<string|int, mixed>
Return values
mixed —readFontStyle()
Read w:rPr
protected
readFontStyle(XMLReader $xmlReader, DOMElement $domNode) : array<string|int, mixed>|null
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
array<string|int, mixed>|null —readParagraph()
Read w:p.
protected
readParagraph(XMLReader $xmlReader, DOMElement $domNode, AbstractContainer $parent[, string $docPart = 'document' ]) : mixed
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
- $parent : AbstractContainer
- $docPart : string = 'document'
Tags
Return values
mixed —readParagraphStyle()
Read w:pPr.
protected
readParagraphStyle(XMLReader $xmlReader, DOMElement $domNode) : array<string|int, mixed>|null
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
array<string|int, mixed>|null —readRun()
Read w:r.
protected
readRun(XMLReader $xmlReader, DOMElement $domNode, AbstractContainer $parent, string $docPart[, mixed $paragraphStyle = null ]) : mixed
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
- $parent : AbstractContainer
- $docPart : string
- $paragraphStyle : mixed = null
Tags
Return values
mixed —readRunChild()
Parses nodes under w:r
protected
readRunChild(XMLReader $xmlReader, DOMElement $node, AbstractContainer $parent, string $docPart[, mixed $paragraphStyle = null ][, mixed $fontStyle = null ]) : mixed
Parameters
- $xmlReader : XMLReader
- $node : DOMElement
- $parent : AbstractContainer
- $docPart : string
- $paragraphStyle : mixed = null
- $fontStyle : mixed = null
Return values
mixed —readStyleDefs()
Read style definition
protected
readStyleDefs(XMLReader $xmlReader[, DOMElement $parentNode = null ][, array<string|int, mixed> $styleDefs = array() ]) : array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $parentNode : DOMElement = null
- $styleDefs : array<string|int, mixed> = array()
Tags
Return values
array<string|int, mixed> —readTable()
Read w:tbl.
protected
readTable(XMLReader $xmlReader, DOMElement $domNode, mixed $parent[, string $docPart = 'document' ]) : mixed
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
- $parent : mixed
- $docPart : string = 'document'
Return values
mixed —readTableStyle()
Read w:tblPr
protected
readTableStyle(XMLReader $xmlReader, DOMElement $domNode) : string|array<string|int, mixed>|null
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Tags
Return values
string|array<string|int, mixed>|null —setConsecutiveHyphenLimit()
protected
setConsecutiveHyphenLimit(XMLReader $xmlReader, PhpWord $phpWord, DOMElement $node) : mixed
Parameters
Return values
mixed —setDocumentProtection()
Sets the document protection
protected
setDocumentProtection(XMLReader $xmlReader, PhpWord $phpWord, DOMElement $node) : mixed
Parameters
Return values
mixed —setHyphenationZone()
protected
setHyphenationZone(XMLReader $xmlReader, PhpWord $phpWord, DOMElement $node) : mixed
Parameters
Return values
mixed —setProofState()
Sets the proof state
protected
setProofState(XMLReader $xmlReader, PhpWord $phpWord, DOMElement $node) : mixed
Parameters
Return values
mixed —setRevisionView()
Set the Revision view
protected
setRevisionView(XMLReader $xmlReader, PhpWord $phpWord, DOMElement $node) : mixed
Parameters
Return values
mixed —setThemeFontLang()
Sets the document Language
protected
setThemeFontLang(XMLReader $xmlReader, PhpWord $phpWord, DOMElement $node) : mixed
Parameters
Return values
mixed —setZoom()
Sets the proof state
protected
setZoom(XMLReader $xmlReader, PhpWord $phpWord, DOMElement $node) : mixed
Parameters
Return values
mixed —findPossibleAttribute()
Returns the first attribute found
private
findPossibleAttribute(XMLReader $xmlReader, DOMElement $node, string|array<string|int, mixed> $attributes) : string|null
Parameters
- $xmlReader : XMLReader
- $node : DOMElement
- $attributes : string|array<string|int, mixed>
Return values
string|null —findPossibleElement()
Returns the first child element found
private
findPossibleElement(XMLReader $xmlReader[, DOMElement|null $parentNode = null ][, string|array<string|int, mixed>|null $elements = null ]) : string|null
Parameters
- $xmlReader : XMLReader
- $parentNode : DOMElement|null = null
- $elements : string|array<string|int, mixed>|null = null
Return values
string|null —getHeadingDepth()
Returns the depth of the Heading, returns 0 for a Title
private
getHeadingDepth([array<string|int, mixed> $paragraphStyle = null ]) : number|null
Parameters
- $paragraphStyle : array<string|int, mixed> = null
Return values
number|null —getMediaTarget()
Returns the target of image, object, or link as stored in ::readMainRels
private
getMediaTarget(string $docPart, string $rId) : string|null
Parameters
- $docPart : string
- $rId : string
Return values
string|null —getTargetMode()
Returns the target mode
private
getTargetMode(string $docPart, string $rId) : string|null
Parameters
- $docPart : string
- $rId : string
Return values
string|null —isOn()
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
bool —readCellStyle()
Read w:tcPr
private
readCellStyle(XMLReader $xmlReader, DOMElement $domNode) : array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
array<string|int, mixed> —readStyleDef()
Return style definition based on conversion method
private
readStyleDef(string $method, string|null $attributeValue, mixed $expected) : mixed
Parameters
- $method : string
- $attributeValue : string|null
- $expected : mixed
Tags
Return values
mixed —readTableIndent()
Read w:tblInd
private
readTableIndent(XMLReader $xmlReader, DOMElement $domNode) : TblWidth
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement
Return values
TblWidth —readTablePosition()
Read w:tblpPr
private
readTablePosition(XMLReader $xmlReader, DOMElement $domNode) : array<string|int, mixed>
Parameters
- $xmlReader : XMLReader
- $domNode : DOMElement