You are here

public function ContentEntityTypes::getResultInfo in Site Audit 8.3

.

Overrides SiteAuditCheckBase::getResultInfo

1 call to ContentEntityTypes::getResultInfo()
ContentEntityTypes::getResultWarn in src/Plugin/SiteAuditCheck/ContentEntityTypes.php
.

File

src/Plugin/SiteAuditCheck/ContentEntityTypes.php, line 27

Class

ContentEntityTypes
Provides the ContentEntityTypes Check.

Namespace

Drupal\site_audit\Plugin\SiteAuditCheck

Code

public function getResultInfo() {
  $ret_val = '';
  if (empty($this->registry->content_entity_type_counts)) {
    if ($this->options['detail']) {
      return $this
        ->t('No entities exist.');
    }
    return $ret_val;
  }
  $table_rows = [];
  foreach ($this->registry->content_entity_type_counts as $entity_type => $bundles) {
    foreach ($bundles as $bundle => $count) {
      $table_rows[] = [
        $entity_type,
        $bundle,
        $count,
      ];
    }
  }
  $header = [
    $this
      ->t('Content Entity'),
    $this
      ->t('Bundle'),
    $this
      ->t('Count'),
  ];
  return [
    '#theme' => 'table',
    '#class' => 'table-condensed',
    '#header' => $header,
    '#rows' => $table_rows,
  ];
}