Galette API documentation
Gestionnaire d’Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace
1.0.0
Galette\IO\CsvOut Class Reference
Inheritance diagram for Galette\IO\CsvOut:
Collaboration diagram for Galette\IO\CsvOut:

Public Member Functions

 __construct ()
 
 export (ResultSet|array $rs, string $separator, string $quote, array|bool $titles=false, mixed $file=false)
 
 getParamedtedExportName (string $id)
 
 getParametedExports ()
 
 runParametedExport (string $id)
 
- Public Member Functions inherited from Galette\IO\Csv
 __construct (string $default_dir)
 
 getExisting ()
 
 remove (string $name)
 
 getAcceptedSeparators ()
 
 getAcceptedQuotes ()
 
 addError (string $msg)
 
 getErrors ()
 

Public Attributes

const DEFAULT_DIRECTORY = GALETTE_EXPORTS_PATH
 
- Public Attributes inherited from Galette\IO\Csv
const NEWLINE = "\r\n"
 
const BUFLINES = 100
 
const DEFAULT_SEPARATOR = ';'
 
const DEFAULT_QUOTE = '"'
 
const FILE_NOT_WRITABLE = -1
 
const DB_ERROR = -2
 

Additional Inherited Members

- Protected Attributes inherited from Galette\IO\Csv
string $separator
 
string $quote
 
string $escaped
 
mixed $file
 
string $result
 
int $current_line
 
array $extensions = array('csv')
 
array $accepted_separators
 
array $accepted_quotes
 

Detailed Description

CSV exports

Author
Johan Cwiklinski johan.nosp@m.@x-t.nosp@m.nd.be

Constructor & Destructor Documentation

◆ __construct()

Galette\IO\CsvOut::__construct ( )

Default constructor

Member Function Documentation

◆ export()

Galette\IO\CsvOut::export ( ResultSet|array  $rs,
string  $separator,
string  $quote,
array|bool  $titles = false,
mixed  $file = false 
)

Export Array result set to CSV

Parameters
ResultSet|array<int,mixed>$rs Results as an array
string$separatorThe CSV separator (either '\t', ';' or ',' are accepted)
string$quotehow does fields should be quoted
array<string>|bool$titles does export shows column titles or not. Defaults to false.
resource | false$fileexport to a file on disk. A file pointer should be passed here. Defaults to false.
Returns
string CSV result

◆ getParamedtedExportName()

Galette\IO\CsvOut::getParamedtedExportName ( string  $id)

Retrieve parameted export name

Parameters
string$idParameted export identifier
Returns
?string

◆ getParametedExports()

Galette\IO\CsvOut::getParametedExports ( )

Get al list of all parameted exports

Returns
array<string, mixed>

◆ runParametedExport()

Galette\IO\CsvOut::runParametedExport ( string  $id)

Run selected export

Parameters
string$idexport's id to run
Returns
?string filename used

The documentation for this class was generated from the following file: