src/tools/DbMergingAggregator.php
/**
     * Aggregates given Charges to Bills.
     * Then merges them with Bills from DB.
     *
     * @param ChargeInterface[]|ChargeInterface[][] $charges
     * @return BillInterface[]
     * @throws \Exception
     */
Aggregates given Charges to Bills.
Then merges them with Bills from DB.


Aggregates given Charges to Bills . Then merges them with Bills from DB .
public function aggregateCharges(array $charges): array
    {
        $localBills = $this->localAggregator->aggregateCharges($charges);
        $dbBills = $this->billRepository->findByUniqueness($localBills);
        $filteredLocalBills = $this->excludeLocalOnlyZeroBills($localBills, $dbBills);
        $res = $this->merger->mergeBills(array_merge($filteredLocalBills, $dbBills));
        return $res;
    }
public function aggregateCharges ( array $ charges ) : array { $ localBills = $ this -> localAggregator -> aggregateCharges ( $ charges ) ; $ dbBills = $ this -> billRepository -> findByUniqueness ( $ localBills ) ; $ filteredLocalBills = $ this -> excludeLocalOnlyZeroBills ( $ localBills , $ dbBills ) ; $ res = $ this -> merger -> mergeBills ( array_merge ( $ filteredLocalBills , $ dbBills ) ) ; return $ res ; }
Aggregates given Charges to Bills.
Aggregates given Charges to Bills .