Overview

Packages

  • Data

Classes

  • Horde_Data
  • Horde_Data_Base
  • Horde_Data_Csv
  • Horde_Data_Exception
  • Horde_Data_Icalendar
  • Horde_Data_Imc
  • Horde_Data_Outlookcsv
  • Horde_Data_Translation
  • Horde_Data_Tsv
  • Horde_Data_Vcard
  • Horde_Data_Vnote
  • Horde_Data_Vtodo
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Data_Tsv

Horde_Data implementation for tab-separated data (TSV).

Copyright 1999-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Horde_Data_Base
Extended by Horde_Data_Tsv
Package: Data
Category: Horde
Author: Jan Schneider jan@horde.org
Author: Chuck Hagenbuch chuck@horde.org
Located at Horde/Data/Tsv.php
Methods summary
public array
# importData( string $contents, boolean $header = false, string $delimiter = "\t" )

Convert data file contents to list of data records.

Convert data file contents to list of data records.

Parameters

$contents
Data file contents.
$header
True if a header row is present.
$delimiter
Field delimiter.

Returns

array
List of data records.

Overrides

Horde_Data_Base::importData()
public string
# exportData( array $data, boolean $header = false )

Builds a TSV file from a given data structure and returns it as a string.

Builds a TSV file from a given data structure and returns it as a string.

Parameters

$data
A two-dimensional array containing the data set.
$header
<p>If true, the rows of $data are associative arrays with field names as their keys.</p>

Returns

string
The TSV data.
public
# exportFile( string $filename, array $data, boolean $header = false )

Builds a TSV file from a given data structure and triggers its download. It DOES NOT exit the current script but only outputs the correct headers and data.

Builds a TSV file from a given data structure and triggers its download. It DOES NOT exit the current script but only outputs the correct headers and data.

Parameters

$filename
The name of the file to be downloaded.
$data
<p>A two-dimensional array containing the data set.</p>
$header
<p>If true, the rows of $data are associative arrays with field names as their keys.</p>
public mixed
# nextStep( integer $action, array $param = array() )

Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.

Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.

Parameters

$action
The current step. One of the IMPORT_* constants.
$param
<p>An associative array containing needed parameters for the current step.</p>

Returns

mixed

Either the next step as an integer constant or imported data set after the final step.

Throws

Horde_Data_Exception

Overrides

Horde_Data_Base::nextStep()
Methods inherited from Horde_Data_Base
__construct(), cleanup(), getContentType(), getFilename(), getNewline(), importFile(), warnings()
API documentation generated by ApiGen