ExportedColumn::TYPE_INTEGER, Variable::TYPE_VARIABLE_BOOLEAN => ExportedColumn::TYPE_BOOLEAN, Variable::TYPE_VARIABLE_IDENTIFIER => ExportedColumn::TYPE_VARCHAR, Variable::TYPE_VARIABLE_DURATION => ExportedColumn::TYPE_DECIMAL, Variable::TYPE_VARIABLE_FLOAT => ExportedColumn::TYPE_DECIMAL ]; private $mappingFieldsTypes = [ 'Start Date' => ExportedColumn::TYPE_TIMESTAMP, 'End Date' => ExportedColumn::TYPE_TIMESTAMP, 'Compilation Time' => ExportedColumn::TYPE_INTEGER, 'Start Delivery Execution' => ExportedColumn::TYPE_TIMESTAMP, 'End Delivery Execution' => ExportedColumn::TYPE_TIMESTAMP ]; /** * @param SqlExporter $exporter * @return string */ protected function getExportData($exporter) { return $exporter->export(); } /** * @inheritdoc */ protected function getExporter(array $data) { foreach ($this->getColumnsToExport() as $columnData) { if ($columnData instanceof VariableColumn) { $type = $columnData->getColumnType() && isset($this->mappingVarTypes[$columnData->getColumnType()]) ? $this->mappingVarTypes[$columnData->getColumnType()] : ExportedColumn::TYPE_VARCHAR; $this->mappingFieldsTypes[$columnData->getLabel()] = $type; } } return new SqlExporter($data, $this->mappingFieldsTypes, 'result_table'); } }