Content extends AbstractPart
ODText content part writer: content.xml.
Table of Contents
- $dateFormat : string
- $parentWriter : AbstractWriter
- Parent writer.
- $autoStyles : array<string|int, mixed>
- Auto style collection.
- $imageParagraphStyles : mixed
- getParentWriter() : AbstractWriter
- Get parent writer.
- setParentWriter() : void
- Set parent writer.
- write() : string
- Write part.
- getXmlWriter() : XMLWriter
- Get XML Writer.
- writeCommonRootAttributes() : void
- Write common root attributes.
- writeFontFaces() : void
- Write font faces declaration.
- writeText() : bool
- Write an XML text, this will call text() or writeRaw() depending on the value of Settings::isOutputEscapingEnabled().
- collectTrackedChanges() : void
- Finds all tracked changes.
- getAutoStyles() : void
- Get automatic styles.
- getContainerStyle() : void
- Get all styles of each elements in container recursively.
- getElementStyle() : void
- Get style of individual element.
- getElementStyleField() : void
- Get font style of individual field element.
- getElementStyleTextRun() : void
- Get style of individual element.
- writeAutoStyles() : void
- Write automatic styles other than fonts and paragraphs.
- writeTextStyles() : void
- Write automatic styles.
Properties
$dateFormat
protected
string
$dateFormat
= 'Y-m-d\TH:i:sP'
$parentWriter
Parent writer.
protected
AbstractWriter
$parentWriter
$autoStyles
Auto style collection.
private
array<string|int, mixed>
$autoStyles
= ['Section' => [], 'Image' => [], 'Table' => []]
Collect inline style information from section, image, and table elements
Tags
$imageParagraphStyles
private
mixed
$imageParagraphStyles
= []
Methods
getParentWriter()
Get parent writer.
public
getParentWriter() : AbstractWriter
Return values
AbstractWriter —setParentWriter()
Set parent writer.
public
setParentWriter([AbstractWriter $writer = null ]) : void
Parameters
- $writer : AbstractWriter = null
Return values
void —write()
Write part.
public
write() : string
Return values
string —getXmlWriter()
Get XML Writer.
protected
getXmlWriter() : XMLWriter
Return values
XMLWriter —writeCommonRootAttributes()
Write common root attributes.
protected
writeCommonRootAttributes(XMLWriter $xmlWriter) : void
Parameters
- $xmlWriter : XMLWriter
Return values
void —writeFontFaces()
Write font faces declaration.
protected
writeFontFaces(XMLWriter $xmlWriter) : void
Parameters
- $xmlWriter : XMLWriter
Return values
void —writeText()
Write an XML text, this will call text() or writeRaw() depending on the value of Settings::isOutputEscapingEnabled().
protected
writeText(string $content) : bool
Parameters
- $content : string
-
The text string to write
Return values
bool —Returns true on success or false on failure
collectTrackedChanges()
Finds all tracked changes.
private
collectTrackedChanges(AbstractContainer $container[, array<string|int, AbstractElement> &$trackedChanges = [] ]) : void
Parameters
- $container : AbstractContainer
- $trackedChanges : array<string|int, AbstractElement> = []
Return values
void —getAutoStyles()
Get automatic styles.
private
getAutoStyles(PhpWord $phpWord) : void
Parameters
- $phpWord : PhpWord
Return values
void —getContainerStyle()
Get all styles of each elements in container recursively.
private
getContainerStyle(AbstractContainer $container, int &$paragraphStyleCount, int &$fontStyleCount) : void
Table style can be null or string of the style name
Parameters
- $container : AbstractContainer
- $paragraphStyleCount : int
- $fontStyleCount : int
Tags
Return values
void —getElementStyle()
Get style of individual element.
private
getElementStyle(Text $element, int &$paragraphStyleCount, int &$fontStyleCount) : void
Parameters
- $element : Text
- $paragraphStyleCount : int
- $fontStyleCount : int
Return values
void —getElementStyleField()
Get font style of individual field element.
private
getElementStyleField(Field $element, int &$fontStyleCount) : void
Parameters
- $element : Field
- $fontStyleCount : int
Return values
void —getElementStyleTextRun()
Get style of individual element.
private
getElementStyleTextRun(TextRun $element, int &$paragraphStyleCount) : void
Parameters
- $element : TextRun
- $paragraphStyleCount : int
Return values
void —writeAutoStyles()
Write automatic styles other than fonts and paragraphs.
private
writeAutoStyles(XMLWriter $xmlWriter) : void
Parameters
- $xmlWriter : XMLWriter
Tags
Return values
void —writeTextStyles()
Write automatic styles.
private
writeTextStyles(XMLWriter $xmlWriter) : void
Parameters
- $xmlWriter : XMLWriter