if (!empty($supplied_parts)): ?> foreach ($supplied_parts AS $row): ?> $supplier = $row['Supplier']; ?> $spart = $row['SupplierPart']; ?> =$supplier->get('name')?> endforeach ?> else: ?> No Suppliers! endif ?>