protected function addToCSV(array $row = [])
    {
        $rowReducedByControlFields = self::removeControlFieldsFromFieldRow($row);
        // Get an field array without control fields but in the expected order
        $fieldArray = array_intersect_key(array_flip($this->fieldArray), $rowReducedByControlFields);
        // Overwrite fieldArray to keep the order with an array of needed fields
        $rowReducedToSelectedColumns = array_replace(
            $fieldArray,
            array_intersect_key($rowReducedByControlFields, $fieldArray)
        );
        $this->setCsvRow($rowReducedToSelectedColumns);
    }
protected function addToCSV(array $row = [])
    {
        $rowReducedByControlFields = self::removeControlFieldsFromFieldRow($row);
        // Get an field array without control fields but in the expected order
        $fieldArray = array_intersect_key(array_flip($this->fieldArray), $rowReducedByControlFields);
        // Overwrite fieldArray to keep the order with an array of needed fields
        $rowReducedToSelectedColumns = array_replace(
            $fieldArray,
            array_intersect_key($rowReducedByControlFields, $fieldArray)
        );
        $this->setCsvRow($rowReducedToSelectedColumns);
    }
protected function addToCSV ( array $ row = [ ] ) { $ rowReducedByControlFields = self :: removeControlFieldsFromFieldRow ( $ row ) ; // Get an field array without control fields but in the expected order $ fieldArray = array_intersect_key ( array_flip ( $ this -> fieldArray ) , $ rowReducedByControlFields ) ; // Overwrite fieldArray to keep the order with an array of needed fields $ rowReducedToSelectedColumns = array_replace ( $ fieldArray , array_intersect_key ( $ rowReducedByControlFields , $ fieldArray ) ) ; $ this -> setCsvRow ( $ rowReducedToSelectedColumns ) ; }
Adds selected columns of one table row as CSV line.

@param mixed[] $row Record array, from which the values of fields found in $this->fieldArray will be listed in the CSV output.
Adds selected columns of one table row as CSV line .