private function createCell() { $cellXml = new \DOMDocument(); $cellXml->loadXML(' <Cell CellOrdinal="0"> <Value>39431.6712</Value> <FmtValue>$39,431.67</FmtValue> <FormatString>Currency</FormatString> </Cell>'); $node = $cellXml->getElementsByTagName('Cell')->item(0); $cell = new CellData(); $cell->hydrate($node); return $cell; }
public function testHydrate() { $cellXml = new \DOMDocument(); $cellXml->loadXML(' <Cell CellOrdinal="0"> <Value>39431.6712</Value> <FmtValue>$39,431.67</FmtValue> <FormatString>Currency</FormatString> </Cell>'); $node = $cellXml->getElementsByTagName('Cell')->item(0); $cell = new CellData(); $cell->hydrate($node); $this->assertEquals($cell->getValue(), 39431.6712); $this->assertEquals($cell->getFormatedValue(), '$39,431.67'); $this->assertEquals($cell->getFormatString(), 'Currency'); }
protected static function hydrateDataSet(\DOMNode $node) { $result = array(); $cellData = $node->getElementsByTagName('Cell'); foreach ($cellData as $data) { $cellOrdinal = self::getAttribute($data, "CellOrdinal"); $cell = new CellData(); $cell->hydrate($data); $result[$cellOrdinal] = $cell; } return $result; }