FreenetIS
 All Classes Namespaces Functions Variables Pages
Protected Member Functions | List of all members
Fio_Bank_Statement_File_Importer Class Reference

FIO abstract importer that handles storing of transfers. More...

Inheritance diagram for Fio_Bank_Statement_File_Importer:
Bank_Statement_File_Importer Csv_Fio_Bank_Statement_File_Importer Json_Fio_Bank_Statement_File_Importer

Protected Member Functions

 before_download (Bank_account_Model $bank_account, Bank_Account_Settings $settings)
 This method may be implemented in order to do some action before downloading of a bank statement.
 get_parsed_transactions ()
 Gets parsed data.
 store (&$stats=array())
 Stores data that are obtain via parse_file_data method (stored internally.
- Protected Member Functions inherited from Bank_Statement_File_Importer
 __construct (Bank_account_Model $bam)
 Creates new instance od bank statement import.
 get_user_id ()
 User ID of caller of this importer.
 get_bank_account ()
 Gets bank account for which the importer is evaulating imports.
 set_file_data ($fd)
 Sets bank statement file data (content of a file)
 get_file_data ()
 Gets bank statement file data (content of a file)
 add_error ($error, $translate=TRUE)
 Adds given error to the start of the error stack.
 add_exception_error (Exception $e, $translate=TRUE)
 Add given exception as error to the start of the error stack.
 add_affected_member ($member_id)
 Adds member as affected by this parsed statement.
 get_errors ()
 Gets error trace.
 find_member_by_vs ($variable_symbol, $error_correction=TRUE)
 Finds member ID by variable method.
 do_download (Bank_account_Model $bank_account, Bank_Account_Settings $settings, $url)
 This method enables to download a bank statement.
 check_file_data_format ()
 Checks whether the file content that is stored into a fileData property has valid format.
 get_header_data ()
 Gets header data of file data format.
 parse_file_data ()
 Parses a file data into a semantic interpretation of its content.
 notify_affected_members ()
 Informs affected members by email or SMS according to setting variables inform_affected_member_by_email and inform_affected_member_by_sms.

Additional Inherited Members

- Public Member Functions inherited from Bank_Statement_File_Importer
 get_importer_name ()
 Get importer name.
- Static Public Member Functions inherited from Bank_Statement_File_Importer
static get_drivers ()
 Gets available drivers.
static download (Bank_account_Model $bank_account, Bank_Account_Settings $settings, $send_emails, $send_sms)
 Tries to download statement and then import it.
static import (Bank_account_Model $bank_account, $filename, $ext, $send_emails=TRUE, $send_sms=FALSE)
 Imports a bank statement placed in a file that is given by the filename to bank account that is given by its database model.
- Public Attributes inherited from Bank_Statement_File_Importer
const DIR = 'importers'
 Dir with driver classes.
- Static Protected Member Functions inherited from Bank_Statement_File_Importer
static factory ($bank_account, $ext)
 Creates an instance of file importer driver that is capable of importing bank statement.

Detailed Description

FIO abstract importer that handles storing of transfers.

Subclass add method for handling different input file types and format.

Author
Ondrej Fibich, Jiri Svitak
Since
1.1

Member Function Documentation

Fio_Bank_Statement_File_Importer::before_download ( Bank_account_Model  $bank_account,
Bank_Account_Settings  $settings 
)
protected

This method may be implemented in order to do some action before downloading of a bank statement.

Does not do anything by default.

Parameters
Bank_account_Model$bank_account
Bank_Account_Settings$settings
Returns
boolean Successfully run?
Exceptions
ExceptionOn any error

Reimplemented from Bank_Statement_File_Importer.

Fio_Bank_Statement_File_Importer::get_parsed_transactions ( )
abstractprotected

Gets parsed data.

Returns
array Contains array of transactions

Reimplemented in Csv_Fio_Bank_Statement_File_Importer, and Json_Fio_Bank_Statement_File_Importer.

Fio_Bank_Statement_File_Importer::store ( $stats = array())
protected

Stores data that are obtain via parse_file_data method (stored internally.

  • so it is in hand of the implemented file importer).

All transfers are stored in the database and grouped using statement entity. This statement entity is than returned.

This method should also set affected members in order to notify them.

An error in the format may be add into error stack (addError) that is later displayed to user if this function returns FALSE.

Parameters
array$statsStatistics about imported statement
Returns
Bank_statement_Model Bank statement that was stored or NULL if bank statement was not stored
Exceptions
Duplicity_ExceptionOn transfers that were already imported

Reimplemented from Bank_Statement_File_Importer.


The documentation for this class was generated from the following file: