My problem was to get the array employeeIds in an array outside a foreach
$jobCard
$jobCard contains an associative in my instance I get the employee_id in the array
$employeeId = array();
foreach ($jobCards as $jobCard) {
$employeeId[] = $jobCard['employee_id'];
}
$employees = Employee::LoadArray($employeeId);
foreach ($employees as $employeeID => $Employee) {
$employeeName[$employeeID] = $Employee->getName();
Console::Log('name', $employeeName);
}
foreach ($jobCards as $jobCard) {
Console::Log('$employeeName', $employeeName);
$notes[] = $employeeName[$employeeID] . "
" .$jobCard['description_notes'];
}
$detail['notes'] = implode("
", $notes);
Console::Log('display', $detail);