$counts =
$this->streamRepository->
fetchStreamsCustomerCount($ids);
foreach ($data as &
$row) { $id =
(int) $row['id'
];
if (!\
array_key_exists($id,
$counts)) { $row['customer_count'
] = 0;
$row['newsletter_count'
] = 0;
} else { $row =
array_merge($row,
$counts[$id]);
} $result =
$this->
updateFrozenState($id,
$row['freezeUp'
],
$row['conditions'
]);
if ($result) { $row['freezeUp'
] =
$result['freezeUp'
];
$row['static'
] =
$result['static'
];
} } return ['success' => true, 'data' =>
$data, 'total' =>
$total];
} /**
* @param bool $index
*
* @throws CustomValidationException
*
* @return CustomerStreamEntity
*/