protected function formatRow($oRow)
    {
        $aItems = array_map(
            function ($sItem) {
                return str_replace('"', '""', trim($sItem));
            },
            (array) $oRow
        );

        return '"' . implode('","', $aItems) . '"' . "\n";
    }
protected function formatRow($oRow)
    {
        $aItems = array_map(
            function ($sItem) {
                return str_replace('"', '""', trim($sItem));
            },
            (array) $oRow
        );

        return '"' . implode('","', $aItems) . '"' . "\n";
    }
protected function formatRow ( $ oRow ) { $ aItems = array_map ( function ( $ sItem ) { return str_replace ( '"' , '""' , trim ( $ sItem ) ) ; } , ( array ) $ oRow ) ; return '"' . implode ( '","' , $ aItems ) . '"' . "\n" ; }
Escapes items to be written to the CSV

@param \stdClass|array $oRow The row to format

@return string
Escapes items to be written to the CSV