Documentation

ImportInterface

Imports data from a specific format into an array

Tags
todo

We export using a generic template. We should define an equally flexible import format, for example based on an RegExes or something like XSLT.

copyright

Cloudrexx AG

author

Michael Ritter michael.ritter@cloudrexx.com

subpackage

lib_convert

Table of Contents

Methods

parseFile()  : void
Returns the content of a file

Methods

parseFile()

Returns the content of a file

public parseFile(Cx $cx, File $file, callable $callback[, int $limit = -1 ][, int $offset = -1 ][, array<string|int, mixed> $options = array() ]) : void

$callback will be called for each entry found in the file. It will receive the data fields of the entry as an array as a first argument, if possible it will be indexed by the key of the field.

$options might change behavior and return format slightly.

Parameters
$cx : Cx
$file : File

File instance to read data from

$callback : callable

Will be called for each row

$limit : int = -1

(optional) Limit the number of rows returned.

$offset : int = -1

(optional) Offset as of which entry limit is counted.

$options : array<string|int, mixed> = array()

(optional) Additional options specific to this importer

Tags
throws
FileException

If the file could not be opened


        
On this page

Search results