Created
July 11, 2016 16:10
-
-
Save matiit/7c88299be723947a5fa58013ee4f9302 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$addedRows = 0; | |
(...) | |
// Keep the order | |
// Reset it here, not in the if, so it always! gets resetted. | |
$addedRowsToCurrent = 0; | |
if ($grouped == AdminList::GROUPED_FOR_TAX_RELIEF && $row['tax_allocation_exists'] == 1) { | |
/** | |
* @var \Crowdcube\TaxReliefAllocator\Service $taxReliefService | |
*/ | |
$taxReliefService = container('tax-relief-service'); | |
$allocation = $taxReliefService->getAllocationsByInvestmentId($row['inv_id']); | |
foreach ($allocation as $allocationRow) { | |
// Keep the indexes. Take the rows added earlier + the rows added now. | |
$investorList[$i + $addedRows + $addedRowsToCurrent] = $investorList[$i]; | |
// Added one row. | |
$addedRowsToCurrent++; | |
} | |
} | |
$i++; | |
$addedRows += $addedRowsToCurrent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment