PHP Класс Horde_Data_Tsv, horde

Copyright 1999-2016 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.
Автор: Jan Schneider ([email protected])
Автор: Chuck Hagenbuch ([email protected])
Наследование: extends Horde_Data_Base
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_contentType string MIME content type.
$_extension string File extension.

Открытые методы

Метод Описание
exportData ( array $data, boolean $header = false ) : string Builds a TSV file from a given data structure and returns it as a string.
exportFile ( string $filename, array $data, boolean $header = false ) Builds a TSV file from a given data structure and triggers its download.
importData ( string $contents, boolean $header = false, string $delimiter = " " ) : array Convert data file contents to list of data records.
nextStep ( integer $action, array $param = [] ) : mixed Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.

Описание методов

exportData() публичный Метод

Builds a TSV file from a given data structure and returns it as a string.
public exportData ( array $data, boolean $header = false ) : string
$data array A two-dimensional array containing the data set.
$header boolean If true, the rows of $data are associative arrays with field names as their keys.
Результат string The TSV data.

exportFile() публичный Метод

It DOES NOT exit the current script but only outputs the correct headers and data.
public exportFile ( string $filename, array $data, boolean $header = false )
$filename string The name of the file to be downloaded.
$data array A two-dimensional array containing the data set.
$header boolean If true, the rows of $data are associative arrays with field names as their keys.

importData() публичный Метод

Convert data file contents to list of data records.
public importData ( string $contents, boolean $header = false, string $delimiter = " " ) : array
$contents string Data file contents.
$header boolean True if a header row is present.
$delimiter string Field delimiter.
Результат array List of data records.

nextStep() публичный Метод

Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.
public nextStep ( integer $action, array $param = [] ) : mixed
$action integer The current step. One of the IMPORT_* constants.
$param array An associative array containing needed parameters for the current step.
Результат mixed Either the next step as an integer constant or imported data set after the final step.

Описание свойств

$_contentType защищенное свойство

MIME content type.
protected string $_contentType
Результат string

$_extension защищенное свойство

File extension.
protected string $_extension
Результат string