From 70b86abba234c2b26841cc1341e144aff45d100c Mon Sep 17 00:00:00 2001 From: Sergio N Date: Mon, 12 Feb 2018 12:30:21 -0300 Subject: [PATCH] support data bool export() support data bool export() --- Controller/Component/CsvComponent.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Controller/Component/CsvComponent.php b/Controller/Component/CsvComponent.php index 1513b60..cbd3fa5 100644 --- a/Controller/Component/CsvComponent.php +++ b/Controller/Component/CsvComponent.php @@ -114,7 +114,13 @@ public function export($filename, $data, $options = array()) { if ($firstRecord) { $headers[] = $this->_encode($model . '.' . $field); } + + if(is_bool($value)){ + $value = ($value)?'1':'0'; + } + $row[] = $this->_encode($value); + } // TODO due to HABTM potentially being huge, creating an else might not be plausible } }