Documentation

CsvLoader extends AbstractLoader
in package

This is a CSV loader

Tags
author

Eric Huang eric.huang@atelli.ai

Table of Contents

$columnNames  : array<string|int, string>
$columns  : array<string|int, mixed>
$currentLength  : int
$currentRows  : int
$data  : array<string|int, array<string|int, mixed>>
$fileManager  : FileManager
$isColumnBase  : bool
$outputWithHeader  : bool
$seperator  : string
__construct()  : mixed
construct
canLoadByLength()  : bool
can load by length
canLoadByRows()  : bool
can load by rows
getData()  : array<string|int, array<string|int, mixed>>
get data
load()  : Result
output current data and generate destination automatically, must set fileManager before using this method
output()  : Result
output current data into specific destination
push()  : void
push
setFileManager()  : void
set filename

Properties

$data

protected array<string|int, array<string|int, mixed>> $data = []

$outputWithHeader

private bool $outputWithHeader = true

Methods

__construct()

construct

public __construct(array<string|int, ColumnInterface$columns[, string $seperator = ',' ][, bool $outputWithHeader = true ]) : mixed
Parameters
$columns : array<string|int, ColumnInterface>
$seperator : string = ','

default: ','

$outputWithHeader : bool = true

default: true

Return values
mixed

canLoadByLength()

can load by length

public canLoadByLength(int $length) : bool
Parameters
$length : int

bytes

Return values
bool

canLoadByRows()

can load by rows

public canLoadByRows(int $rows) : bool
Parameters
$rows : int
Return values
bool

getData()

get data

public getData() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>>

load()

output current data and generate destination automatically, must set fileManager before using this method

public load() : Result
Return values
Result

output()

output current data into specific destination

public output(string $dest) : Result
Parameters
$dest : string
Return values
Result

push()

push

public push(array<string|int, mixed> $values[, bool $isAssoc = true ]) : void
Parameters
$values : array<string|int, mixed>
$isAssoc : bool = true

default: true

Return values
void

Search results