/** * Process a new transaction * * The param $oReversedLedgerTrans is not used here. * * Execute the assigned steps in the order they are passed into the constructor. * * @param LedgerTransaction $oLedgerTrans The new transaction to make * @param array $aLedgerEntries Array of Ledger Entries (account movements) to save * @param LedgerTransaction $oAdjustedLedgerTrans The transaction that is to be reversed by this new transaction */ public function process(LedgerTransaction $oLedgerTrans, array $aLedgerEntries, LedgerTransaction $oAdjustedLedgerTrans = null) { # execute the parent process this ensure the basic transction is saved $bSuccess = $this->oProcessor->process($oLedgerTrans, $aLedgerEntries, $oAdjustedLedgerTrans); if (true === $bSuccess) { if (true === empty($oLedgerTrans->iTransactionID)) { throw new LedgerException('The transaction does not have and id assigned unable to process extra steps'); } foreach ($this->aSteps as $oProcessor) { $bSuccess = $oProcessor->process($oLedgerTrans, $aLedgerEntries, $oAdjustedLedgerTrans); if (false === $bSuccess) { break; } } } return $bSuccess; }
/** * Process a new transaction * * The param $oReversedLedgerTrans is only required if creating a reversal. * * @param LedgerTransaction $oLedgerTrans The new transaction to make * @param array $aLedgerEntries Array of Ledger Entries (account movements) to save * @param LedgerTransaction $oAdjustedLedgerTrans The transaction that is to be reversed by this new transaction */ public function process(LedgerTransaction $oLedgerTrans, array $aLedgerEntries, LedgerTransaction $oAdjustedLedgerTrans = null) { return $this->oProcessor->process($oLedgerTrans, $aLedgerEntries, $oAdjustedLedgerTrans); }