Properties

$delimiter

$delimiter : string

Type

string — CSV delimiter

$enclosure

$enclosure : string

Type

string — CSV enclosure

$observers

$observers : array

Type

array — Observer list

$currentLine

$currentLine : integer

Type

integer — Processed line

$currentTransactionParameters

$currentTransactionParameters : array

Type

array — Current transaction parameters

$currentTransactionResult

$currentTransactionResult : array

Type

array — Current transaction result

$headers

$headers : \CSV

Type

\CSV — headers

$inputFile

$inputFile : string

Type

string — Input file

$inputFd

$inputFd : resource

Type

resource — Input file descriptor

Methods

setInputFile()

setInputFile(resource|string  $file) 

Set input file

Parameters

resource|string $file

run()

run() : boolean

Process the batch

Returns

boolean

attach()

attach(\SplObserver  $observer) : void

(PHP 5 &gt;= 5.1.0)<br/> Attach an SplObserver

Parameters

\SplObserver $observer

The SplObserver to attach.

detach()

detach(\SplObserver  $observer) : void

(PHP 5 &gt;= 5.1.0)<br/> Detach an observer

Parameters

\SplObserver $observer

The SplObserver to detach.

notify()

notify() : void

(PHP 5 &gt;= 5.1.0)<br/> Notify an observer

getCurrentLine()

getCurrentLine() : integer

Return current line

Returns

integer

getCurrentTransactionParameters()

getCurrentTransactionParameters() : mixed

Return current transaction parameters

Returns

mixed

getCurrentTransactionResult()

getCurrentTransactionResult() : mixed

Return current transaction result

Returns

mixed

getFile()

getFile() : string

Return input file name

Returns

string

getInputFileDescriptor()

getInputFileDescriptor() : resource

Return input file descriptor

Returns

resource

getDelimiter()

getDelimiter() : string

Return CSV delimiter

Returns

string

getEnclosure()

getEnclosure() : string

Return CSV enclosure

Returns

string

__destruct()

__destruct() 

Reset resources

getCsvHeaders()

getCsvHeaders() : array

Return CSV headers

Returns

array

getCsvLine()

getCsvLine(array  $headers) : array

Return CSV line

Parameters

array $headers

Throws

\Dalenys_Api_Batch_Exception_InvalidBatchFile

Returns

array

validateFileHeaders()

validateFileHeaders(  $headers) 

Validate headers

Should not contains IDENTIFIER and HASH

Parameters

$headers

Throws

\Dalenys_Api_Batch_Exception_InvalidBatchFile

prepareTransactionParameters()

prepareTransactionParameters(  $params) : array

Prepare transaction parameters before sending

Calculate hash and append identifier

Parameters

$params

Returns

array