You are here

protected function RenderedFlags::renderError in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 modules/cms_content_sync_views/src/Plugin/views/field/RenderedFlags.php \Drupal\cms_content_sync_views\Plugin\views\field\RenderedFlags::renderError()
  2. 2.1.x modules/cms_content_sync_views/src/Plugin/views/field/RenderedFlags.php \Drupal\cms_content_sync_views\Plugin\views\field\RenderedFlags::renderError()

Parameters

string $flag:

array $details:

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup

1 call to RenderedFlags::renderError()
RenderedFlags::render in modules/cms_content_sync_views/src/Plugin/views/field/RenderedFlags.php
inheritdoc}

File

modules/cms_content_sync_views/src/Plugin/views/field/RenderedFlags.php, line 93

Class

RenderedFlags
Views Field handler to check if a entity is pulled.

Namespace

Drupal\cms_content_sync_views\Plugin\views\field

Code

protected function renderError($flag, $details) {
  if (empty(self::FLAG_DESCRIPTION[$flag])) {
    $message = $flag . ' (%error)';
  }
  else {
    $message = self::FLAG_DESCRIPTION[$flag];
  }
  if (empty($details['error'])) {
    $error = 'unknown';
  }
  elseif (empty(self::ERROR_DESCRIPTION[$details['error']])) {
    $error = $details['error'];
  }
  else {
    $error = self::ERROR_DESCRIPTION[$details['error']];
  }
  return $this
    ->t($message, [
    '%error' => $this
      ->t($error),
  ]);
}