MiconContentTypeListBuilder.php in Micon 8
File
micon_content_type/src/MiconContentTypeListBuilder.php
View source
<?php
namespace Drupal\micon_content_type;
use Drupal\node\NodeTypeListBuilder;
use Drupal\Core\Entity\EntityInterface;
class MiconContentTypeListBuilder extends NodeTypeListBuilder {
public function buildHeader() {
$header['icon'] = t('Icon');
return $header + parent::buildHeader();
}
public function buildRow(EntityInterface $entity) {
$icon = micon_content_type_icon($entity);
$row['icon']['data']['#markup'] = $icon ? micon()
->setIcon($icon) : '';
return $row + parent::buildRow($entity);
}
}