/** * Returns an array to be used as the `data` property of the output Javascript object * * @return mixed[] */ private function createDataProperty() { $data = array(); foreach ($this->data->getRows() as $row) { $item = new \stdClass(); foreach ($row->getCells() as $cell) { if ($cell->getColumn()->getType() == Column::TYPE_DATETIME) { $item->{$cell->getColumn()->getId()} = $cell->value->format('Y-m-d h:i:s.u'); } elseif ($cell->getColumn()->getType() == Column::TYPE_DATE) { $item->{$cell->getColumn()->getId()} = $cell->value->format('Y-m-d'); } else { $item->{$cell->getColumn()->getId()} = $cell->value; } } $data[] = $item; } return $data; }