OnlyOnePrintAdminPage.php in Allow a content type only once (Only One) 8
File
src/OnlyOnePrintAdminPage.php
View source
<?php
namespace Drupal\onlyone;
class OnlyOnePrintAdminPage implements OnlyOnePrintStrategyInterface {
public function getContentTypesListForPrint(array $content_types) {
$list = [];
foreach ($content_types as $content_type => $content_type_info) {
$cant = count($content_type_info);
for ($i = 0; $i < $cant; $i++) {
$list[$content_type] = $content_type_info[$i]->name . ' <strong>(' . implode(', ', array_column($content_type_info, 'total_nodes')) . ')</strong>';
}
}
return $list;
}
}