RSI helpers  0.1
RSI helpers
Csv Class Reference

CSV wrapper. More...

Public Member Functions

 __construct ($filename, $mode='r', $delimiter=',', $enclosure='"',$escape = '\)
 
 __destruct ()
 
 get ($filler=null)
 Read a single record from the file. More...
 
 put ($fields, $filler=null)
 Write a single record to the file. More...
 
 getKeys ()
 Read the keys from the file and store them. More...
 
 putKeys ($keys)
 Write the keys to the file and store them. More...
 
 getAll ($filler=null)
 Return all remaining records from the file. More...
 
 close ()
 Close the file. More...
 
 __call ($func_name, $params)
 

Data Fields

 $keys = null
 

Protected Attributes

 $_handle = null
 
 $_delimiter = null
 
 $_enclosure = null
 
 $_escape = null
 

Detailed Description

CSV wrapper.

Definition at line 8 of file Csv.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $filename,
  $mode = 'r',
  $delimiter = ',',
  $enclosure = '"',
  $escape = '\\' 
)

Definition at line 17 of file Csv.php.

◆ __destruct()

__destruct ( )

Definition at line 24 of file Csv.php.

Member Function Documentation

◆ __call()

__call (   $func_name,
  $params 
)

Definition at line 85 of file Csv.php.

◆ close()

close ( )

Close the file.

Definition at line 80 of file Csv.php.

◆ get()

get (   $filler = null)

Read a single record from the file.

Parameters
string$fillerFiller to use if record is shorter than keys (if any).
Returns
array Record, ordered and with keys if any.

Definition at line 32 of file Csv.php.

◆ getAll()

getAll (   $filler = null)

Return all remaining records from the file.

Parameters
string$fillerFiller to use if record is shorter than keys (if any).
Returns
array Array of records.

Definition at line 72 of file Csv.php.

◆ getKeys()

getKeys ( )

Read the keys from the file and store them.

Returns
array

Definition at line 54 of file Csv.php.

◆ put()

put (   $fields,
  $filler = null 
)

Write a single record to the file.

Parameters
array$fieldsValues.
string$fillerFiller to use if array of values does not contain all keys (if any).
Returns
int Length of the written string or FALSE on failure.

Definition at line 42 of file Csv.php.

◆ putKeys()

putKeys (   $keys)

Write the keys to the file and store them.

Parameters
array$keys

Definition at line 62 of file Csv.php.

Field Documentation

◆ $_delimiter

$_delimiter = null
protected

Definition at line 13 of file Csv.php.

◆ $_enclosure

$_enclosure = null
protected

Definition at line 14 of file Csv.php.

◆ $_escape

$_escape = null
protected

Definition at line 15 of file Csv.php.

◆ $_handle

$_handle = null
protected

Definition at line 12 of file Csv.php.

◆ $keys

$keys = null

Definition at line 10 of file Csv.php.


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