private function generateArrayToTable($addressesArray, $firstEmptyCell)
{
$result[] = array();
$row = 0;
if ($firstEmptyCell > 1) {
for ($i = 1; $i < $firstEmptyCell; $i++) {
if ($i % $this->cols == 1) {
$colCount = 0;
} else {
if ($i % $this->cols == 2) {
$colCount = 1;
} else {
$colCount = 2;
}
}
$result[$row][$colCount] = '';
if ($i % $this->cols == 0) {
$row++;
}
}
} else {
$i = 1;
}
foreach ($addressesArray as $key => $val) {
if ($i % $this->cols == 1) {
$colCount = 0;
} else {
if ($i % $this->cols == 2) {
$colCount = 1;
} else {
$colCount = 2;
}
}
$result[$row][$colCount] = $val;
if ($i % $this->cols === 0) {
$row++;
}
$i++;
}
return $result;
}