Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
OpenSpout\Reader\ODS\Helper\CellValueFormatter Class Reference

Public Member Functions

 __construct (bool $shouldFormatDates, ODS $escaper)
 
 extractAndFormatNodeValue (DOMElement $node)
 Returns the (unescaped) correctly marshalled, cell value associated to the given XML node.
 

Public Attributes

const CELL_TYPE_BOOLEAN = 'boolean'
 
const CELL_TYPE_CURRENCY = 'currency'
 
const CELL_TYPE_DATE = 'date'
 
const CELL_TYPE_FLOAT = 'float'
 
const CELL_TYPE_PERCENTAGE = 'percentage'
 
const CELL_TYPE_STRING = 'string'
 Definition of all possible cell types.
 
const CELL_TYPE_TIME = 'time'
 
const CELL_TYPE_VOID = 'void'
 
const XML_ATTRIBUTE_BOOLEAN_VALUE = 'office:boolean-value'
 
const XML_ATTRIBUTE_C = 'text:c'
 
const XML_ATTRIBUTE_CURRENCY = 'office:currency'
 
const XML_ATTRIBUTE_DATE_VALUE = 'office:date-value'
 
const XML_ATTRIBUTE_TIME_VALUE = 'office:time-value'
 
const XML_ATTRIBUTE_TYPE = 'office:value-type'
 Definition of XML attributes used to parse data.
 
const XML_ATTRIBUTE_VALUE = 'office:value'
 
const XML_NODE_P = 'p'
 Definition of XML nodes names used to parse data.
 
const XML_NODE_TEXT_A = 'text:a'
 
const XML_NODE_TEXT_LINE_BREAK = 'text:line-break'
 
const XML_NODE_TEXT_S = 'text:s'
 
const XML_NODE_TEXT_SPAN = 'text:span'
 
const XML_NODE_TEXT_TAB = 'text:tab'
 

Constructor & Destructor Documentation

◆ __construct()

OpenSpout\Reader\ODS\Helper\CellValueFormatter::__construct ( bool $shouldFormatDates,
ODS $escaper )
Parameters
bool$shouldFormatDatesWhether date/time values should be returned as PHP objects or be formatted as strings
ODS$escaperUsed to unescape XML data

Member Function Documentation

◆ extractAndFormatNodeValue()

OpenSpout\Reader\ODS\Helper\CellValueFormatter::extractAndFormatNodeValue ( DOMElement $node)

Returns the (unescaped) correctly marshalled, cell value associated to the given XML node.

See also
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#refTable13
Return values
bool|DateInterval|DateTimeImmutable|float|int|stringThe value associated with the cell, empty string if cell's type is void/undefined
Exceptions
InvalidValueExceptionIf the node value is not valid

The documentation for this class was generated from the following file: