Skip to content

Commit

Permalink
[#9] adjusted getValue signature to recent CiviBanking versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bjendres committed Mar 4, 2024
1 parent 613f74d commit 6d56dfa
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions CRM/Banking/PluginImpl/Importer/CODA.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,37 @@ class CRM_Banking_PluginImpl_Importer_CODA extends CRM_Banking_PluginImpl_Import
*/
protected $account_cache = array();

/**
/**
* the plugin's user readable name
*
*
* @return string
*/
static function displayName()
{
return 'CODA Importer';
}

/**
/**
* Report if the plugin is capable of importing files
*
*
* @return bool
*/
static function does_import_files()
{
return true;
}

/**
/**
* Report if the plugin is capable of importing streams, i.e. data from a non-file source, e.g. the web
*
*
* @return bool
*/
static function does_import_stream()
{
return false;
}

/**
/**
* Test if the given file can be imported
*/
function probe_file( $file_path, $params )
Expand All @@ -77,10 +77,10 @@ function probe_file( $file_path, $params )
}


/**
/**
* Import the given file
*
* @return TODO: data format?
*
* @return TODO: data format?
*/
function import_file( $file_path, $params )
{
Expand Down Expand Up @@ -147,9 +147,9 @@ function import_file( $file_path, $params )

if ($this->account_cache[$value] != NULL) {
if (substr($key, 0, 7)=="_party_") {
$transaction_data['party_ba_id'] = $this->account_cache[$value];
$transaction_data['party_ba_id'] = $this->account_cache[$value];
} elseif (substr($key, 0, 1)=="_") {
$transaction_data['ba_id'] = $this->account_cache[$value];
$transaction_data['ba_id'] = $this->account_cache[$value];
}
}
}
Expand All @@ -166,7 +166,7 @@ function import_file( $file_path, $params )
}
$transaction_data['data_parsed'] = json_encode($transaction_data_extra);
$transaction_data['bank_reference'] = sha1(print_r($transaction_data, 1));

// and finally write it into the DB
$progress = (float) $total_processed / (float) $total_count;
$duplicate = $this->checkAndStoreBTX($transaction_data, $progress, $params);
Expand Down Expand Up @@ -195,7 +195,7 @@ function import_file( $file_path, $params )
} else {
$this->closeTransactionBatch(FALSE);
}

} // NEXT STATEMENT

$this->reportDone();
Expand All @@ -204,7 +204,7 @@ function import_file( $file_path, $params )
/**
* Extract the value for the given key from the CODA resource
*/
protected function getValue($key, $btx, $line=NULL, $header=array()) {
protected function getValue($key, $btx, $line=NULL, $header=[], $params = []) {
// get value
if (substr($key, 0, 10) == '_constant:') {
return substr($key, 10);
Expand Down Expand Up @@ -236,21 +236,21 @@ protected function getValue($key, $btx, $line=NULL, $header=array()) {



/**
/**
* Test if the configured source is available and ready
*
* @var
*
* @var
* @return TODO: data format?
*/
function probe_stream( $params )
{
return false;
}

/**
/**
* Import the given file
*
* @return TODO: data format?
*
* @return TODO: data format?
*/
function import_stream( $params )
{
Expand Down

0 comments on commit 6d56dfa

Please sign in to comment.