Class Horde_Data_tsv

Description

Horde_Data implementation for tab-separated data (TSV).

$Horde: framework/Data/Data/tsv.php,v 1.23.10.17 2009/01/06 15:23:01 jan Exp $

Copyright 1999-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Data/Data/tsv.php (line 17)

PEAR
   |
   --Horde_Data
      |
      --Horde_Data_tsv
Variable Summary
Method Summary
 string exportData (array $data, [boolean $header = false])
 void exportFile (string $filename, array $data, [boolean $header = false])
 array importData (string $contents, [boolean $header = false], [string $delimiter = "\t"])
 mixed nextStep (integer $action, [array $param = array()])
Variables
mixed $_contentType = 'text/tab-separated-values' (line 20)

Redefinition of:
Horde_Data::$_contentType
MIME content type.
mixed $_extension = 'tsv' (line 19)

Redefinition of:
Horde_Data::$_extension
File extension.

Inherited Variables

Inherited from Horde_Data

Horde_Data::$_warnings
Methods
exportData (line 69)

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

  • return: The TSV data.
string exportData (array $data, [boolean $header = false])
  • array $data: A two-dimensional array containing the data set.
  • boolean $header: If true, the rows of $data are associative arrays with field names as their keys.

Redefinition of:
Horde_Data::exportData()
Stub to return exported data.
exportFile (line 103)

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.

void exportFile (string $filename, array $data, [boolean $header = false])
  • string $filename: The name of the file to be downloaded.
  • array $data: A two-dimensional array containing the data set.
  • boolean $header: If true, the rows of $data are associative arrays with field names as their keys.

Redefinition of:
Horde_Data::exportFile()
Stub to export data to a file.
importData (line 31)

Convert data file contents to list of data records.

  • return: List of data records.
array importData (string $contents, [boolean $header = false], [string $delimiter = "\t"])
  • string $contents: Data file contents.
  • boolean $header: True if a header row is present.
  • string $delimiter: Field delimiter.

Redefinition of:
Horde_Data::importData()
Stub to import passed data.
nextStep (line 121)

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

  • return: Either the next step as an integer constant or imported data set after the final step.
mixed nextStep (integer $action, [array $param = array()])
  • integer $action: The current step. One of the IMPORT_* constants.
  • array $param: An associative array containing needed parameters for the current step.

Redefinition of:
Horde_Data::nextStep()
Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.

Inherited Methods

Inherited From Horde_Data

 Horde_Data::cleanup()
 Horde_Data::exportData()
 Horde_Data::exportFile()
 Horde_Data::factory()
 Horde_Data::getContentType()
 Horde_Data::getFilename()
 Horde_Data::getNewline()
 Horde_Data::importData()
 Horde_Data::importFile()
 Horde_Data::nextStep()
 Horde_Data::singleton()
 Horde_Data::warnings()

Documentation generated on Sun, 30 Jan 2011 05:22:58 +0000 by phpDocumentor 1.4.3