public function writeCsv( array $dataRow, string $delimiter = ',', bool $fast = false ) : bool
   {

      if ( ! $fast )
      {
         // No fast (insecure) access = do the required checks
         if ( ! $this->isOpen() )
         {
            return false;
         }
         if ( ! $this->hasWriteAccess() )
         {
            throw FileAccessError::Write(
               'IO',
               $this->file,
               \sprintf( 'Current mode of opened file is "%s" and not write!', $this->access )
            );
         }
      }

      try { \fputcsv( $this->fp, $dataRow, $delimiter ); }
      catch ( \Throwable $ex )
      {
         throw new FileAccessError(
            'IO',
            $this->file,
            FileAccessError::ACCESS_WRITE,
            'Writing of CSV-Data fails.',
            \E_USER_ERROR,
            $ex
         );
      }

      return true;

   }
public function writeCsv( array $dataRow, string $delimiter = ',', bool $fast = false ) : bool
   {

      if ( ! $fast )
      {
         // No fast (insecure) access = do the required checks
         if ( ! $this->isOpen() )
         {
            return false;
         }
         if ( ! $this->hasWriteAccess() )
         {
            throw FileAccessError::Write(
               'IO',
               $this->file,
               \sprintf( 'Current mode of opened file is "%s" and not write!', $this->access )
            );
         }
      }

      try { \fputcsv( $this->fp, $dataRow, $delimiter ); }
      catch ( \Throwable $ex )
      {
         throw new FileAccessError(
            'IO',
            $this->file,
            FileAccessError::ACCESS_WRITE,
            'Writing of CSV-Data fails.',
            \E_USER_ERROR,
            $ex
         );
      }

      return true;

   }
public function writeCsv ( array $ dataRow , string $ delimiter = ',' , bool $ fast = false ) : bool { if ( ! $ fast ) { // No fast (insecure) access = do the required checks if ( ! $ this -> isOpen ( ) ) { return false ; } if ( ! $ this -> hasWriteAccess ( ) ) { throw FileAccessError :: Write ( 'IO' , $ this -> file , \ sprintf ( 'Current mode of opened file is "%s" and not write!' , $ this -> access ) ) ; } } try { \ fputcsv ( $ this -> fp , $ dataRow , $ delimiter ) ; } catch ( \ Throwable $ ex ) { throw new FileAccessError ( 'IO' , $ this -> file , FileAccessError :: ACCESS_WRITE , 'Writing of CSV-Data fails.' , \ E_USER_ERROR , $ ex ) ; } return true ; }
Write a csv format data row, defined as array.

@param  array   $dataRow           The data row to write (numeric indicated array)
@param  string  $delimiter         The CSV column delimiter char. (default=',')
@param  boolean $fast              Write fast without some checks? (Defaults to FALSE)
@return boolean
@throws FileAccessError If writing is not allowed or if it fails.
Write a csv format data row defined as array .