Payment_DTA
[ class tree: Payment_DTA ] [ index: Payment_DTA ] [ all elements ]

Class: DTABase

Source Location: /Payment_DTA-1.4.3/DTABase.php

Class Overview


DTABase class provides common functions to classes DTA and DTAZV.


Author(s):

Version:

  • Release: 1.4.3

Variables

Methods


Child classes:

DTAZV
DTAZV class provides functions to create and handle with DTAZV files used in Germany to exchange informations about european money transactions with banks or online banking programs.
DTA
Dta class provides functions to create and handle with DTA files used in Germany to exchange informations about money transactions with banks or online banking programs.

Inherited Variables

Inherited Methods


Class Details

[line 129]
DTABase class provides common functions to classes DTA and DTAZV.


[ Top ]


Class Variables

$account_file_sender =

[line 137]

Account data for the file sender.
  • Access: protected

Type:   array


[ Top ]

$allerrors =

[line 168]

Array of all parsing problems.
  • Access: protected

Type:   array


[ Top ]

$exchanges =

[line 153]

Array of exchanges that the DTA file should contain.
  • Access: protected

Type:   array


[ Top ]

$iterator_position =  0

[line 685]

  • Access: protected

Type:   mixed


[ Top ]

$sum_amounts =

[line 161]

Sum of amounts in exchanges (in Cents); for control total fields.
  • Access: protected

Type:   integer


[ Top ]

$timestamp =

[line 145]

Current timestamp.
  • Access: protected

Type:   integer


[ Top ]



Method Detail

__construct (Constructor)   [line 184]

DTABase __construct( )

Constructor.

Overridden in child classes as:

DTAZV::__construct()
Constructor.
DTA::__construct()
Constructor. Creates an empty DTA object or imports one.

[ Top ]

addExchange   [line 668]

boolean addExchange( array $account_receiver, double $amount, array $purposes, [array $account_sender = array()])

Adds an exchange. First the account data for the receiver of the exchange is set. In the case the DTA file contains credits, this is the payment receiver.

If the sender is not specified, values of the file sender are used by default.

Account data for receiver and sender contain the following fields: name Name. bank_code Bank code. account_number Account number. additional_name If necessary, additional line for name.

  • Abstract:
  • Access: public

Overridden in child classes as:

DTAZV::addExchange()
Adds an exchange.
DTA::addExchange()
Adds an exchange. First the account data for the receiver of the exchange is set. In the case the DTA file contains credits, this is the payment receiver.

Parameters:

array   $account_receiver   —  Receiver's account data.
double   $amount   —  Amount of money in this exchange. Currency: EURO
array   $purposes   —  An Array of lines or a string for description of the exchange.
array   $account_sender   —  Sender's account data.

[ Top ]

checkStr   [line 227]

boolean checkStr( string $input, integer &$offset, string $expected)

Checks if string $input contains the expected value at an offset.

After the check the offset is increased.

  • Return: true if input is as expected, otherwise an exception is thrown
  • Throws: Payment_DTA_Exception if input differs from expected string
  • Access: protected

Parameters:

string   $input   —  string to check
integer   &$offset   —  current offset into input
string   $expected   —  expected string at the offset

[ Top ]

count   [line 176]

integer count( )

Return number of exchanges
  • Access: public

[ Top ]

current   [line 686]

void current( )


[ Top ]

filter   [line 581]

string filter( string $str, int $len)

Auxillary method to filter output strings.
  • Access: protected

Parameters:

string   $str   —  Text to filter
int   $len   —  Length of text field

[ Top ]

getFileContent   [line 682]

string getFileContent( )

Returns the full content of the generated file.

All added exchanges are processed.

  • Abstract:
  • Access: public

Overridden in child classes as:

DTAZV::getFileContent()
Returns the full content of the generated DTAZV file.
DTA::getFileContent()
Returns the full content of the generated DTA file.

[ Top ]

getMetaData   [line 618]

array getMetaData( )

Returns an array with information about the transactions.

Can be used to print an accompanying document (Begleitzettel) for disks.

  • Return: Returns an array with keys: "sender_name", "sender_bank_code", "sender_account", "sum_amounts", "count", "date"
  • Access: public

Overridden in child classes as:

DTAZV::getMetaData()
Returns an array with information about the transactions.
DTA::getMetaData()
Returns an array with information about the transactions.

[ Top ]

getNum   [line 294]

int getNum( string $input, integer &$offset, integer $length)

Read integer number of given length from input at offset.

Afterwards the offset is increased.

  • Return: the read number
  • Throws: Payment_DTA_Exception if input is too short or contains invalid chars
  • Access: protected

Parameters:

string   $input   —  string to check
integer   &$offset   —  current offset into input
integer   $length   —  chars to read

[ Top ]

getParsingErrors   [line 210]

array getParsingErrors( )

Get parsing errors.

Returns an array with all exceptions thrown when parsing DTA data; possible elements are:

  • None: if no errors occured this array is empty,
  • Payment_DTA_ChecksumException indicates that the complete DTA file was read into the object but the file's internal checksums were incorrect,
  • Payment_DTA_ParseException indicates an error in the input, but all transactions up to the unexpected field were read into the new object,
  • Payment_DTA_FatalParseException indicates a fatal error, thus the constructed object is empty.

  • Access: public

[ Top ]

getStr   [line 260]

string getStr( string $input, integer &$offset, integer $length, [bool $liberal = false])

Read string of given length from input at offset.

Afterwards the offset is increased. By default only a subset of ASCII is allowed (as specified by DTA), with $liberal = true apply makeValidString() first in order to accept lower case and some 8-bit chars. (NB: in this case the returned string may be up to twice as long.)

  • Return: the read string
  • Throws: Payment_DTA_Exception if input is too short or contains invalid chars
  • Access: protected

Parameters:

string   $input   —  string to check
integer   &$offset   —  current offset into input
integer   $length   —  chars to read
bool   $liberal   —  allow 8-bit chars

[ Top ]

key   [line 690]

void key( )


[ Top ]

makeValidString   [line 336]

string makeValidString( string $string)

Makes the given string valid for DTA files.

Some diacritics, especially German umlauts become uppercase, all other chars not allowed are replaced with space.

  • Access: public

Parameters:

string   $string   —  String that should made valid.

[ Top ]

next   [line 694]

void next( )


[ Top ]

rewind   [line 698]

void rewind( )


[ Top ]

saveFile   [line 594]

boolean saveFile( string $filename)

Writes the DTA file.
  • Access: public

Parameters:

string   $filename   —  Filename.

[ Top ]

setAccountFileSender   [line 645]

boolean setAccountFileSender( array $account)

Set the sender of the file.

The given account data is also used as default sender's account.

Account data contains name Sender's name. additional_name Sender's additional name. bank_code Sender's bank code. account_number Sender's account number.

  • Abstract:
  • Access: public

Overridden in child classes as:

DTAZV::setAccountFileSender()
Set the sender of the DTAZV file. Must be set for valid DTAZV file.
DTA::setAccountFileSender()
Set the sender of the DTA file. Must be set for valid DTA file.

Parameters:

array   $account   —  Account data for file sender.

[ Top ]

valid   [line 702]

void valid( )


[ Top ]

validString   [line 321]

boolean validString( string $string)

Checks if the given string contains only chars valid for fields in DTA files.
  • Access: public

Parameters:

string   $string   —  String that is checked.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:49:02 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.