solodkiy/alfabank-ru-csv-analyzer

0.1.6 2021-09-07 17:08 UTC

This package is auto-updated.

Last update: 2024-11-08 00:49:33 UTC


README

TransactionsComparator Поволяет анализировать csv скаченные с click.alfabank.ru, а также сравнивать их между собой

$loader = new CsvLoader();
$currentCollection = YourStorage::loadCurrentTransactionsFromDb();
$newCollection = $loader->loadFromFile(__DIR__ .'/../tests/data/movementList_2018-03-07_19:45:18.csv');

$differ = new TransactionsComparator();
$diff = $differ->diff($currentCollection, $newCollection);

YourStorage::insertTransactionsToDb($diff->getNewCommitted());
YourStorage::insertTransactionsToDb($diff->getNewHold());
YourStorage::updateTransactionsInDb($diff->getUpdated());
YourStorage::deleteTransactionsFromDb($diff->getDeletedIds());