Skip to content

Instantly share code, notes, and snippets.

@matiit
Created July 11, 2016 16:10
Show Gist options
  • Save matiit/7c88299be723947a5fa58013ee4f9302 to your computer and use it in GitHub Desktop.
Save matiit/7c88299be723947a5fa58013ee4f9302 to your computer and use it in GitHub Desktop.
<?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