Sonata\Exporter\Writer\XmlExcelWriter::getDataType PHP Method

getDataType() private method

private getDataType ( string $key, string $value ) : string
$key string
$value string
return string
    private function getDataType($key, $value)
    {
        $dataType = null;
        if (!is_null($this->columnsType)) {
            if (is_string($this->columnsType)) {
                $dataType = $this->columnsType;
            } elseif (is_array($this->columnsType)) {
                if (array_key_exists($key, $this->columnsType)) {
                    $dataType = $this->columnsType[$key];
                }
            }
        }
        if (is_null($dataType)) {
            // guess the type
            if (is_numeric($value)) {
                $dataType = 'Number';
            } else {
                $dataType = 'String';
            }
        }
        return $dataType;
    }