You are here

public function PoolLabel::render 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/PoolLabel.php \Drupal\cms_content_sync_views\Plugin\views\field\PoolLabel::render()
  2. 2.1.x modules/cms_content_sync_views/src/Plugin/views/field/PoolLabel.php \Drupal\cms_content_sync_views\Plugin\views\field\PoolLabel::render()

inheritdoc}

Parameters

\Drupal\views\ResultRow $values:

Return value

\Drupal\Component\Render\MarkupInterface|TranslatableMarkup|ViewsRenderPipelineMarkup|string

Overrides FieldPluginBase::render

File

modules/cms_content_sync_views/src/Plugin/views/field/PoolLabel.php, line 49

Class

PoolLabel
Views Field handler for the pool label.

Namespace

Drupal\cms_content_sync_views\Plugin\views\field

Code

public function render(ResultRow $values) {

  /**
   * @var \Drupal\cms_content_sync\Entity\Pool $entity
   */
  $entity = $values->_entity;
  $pool = \Drupal::entityTypeManager()
    ->getStorage('cms_content_sync_pool')
    ->load($entity
    ->get('pool')->value);
  if (isset($pool)) {
    return $pool
      ->label();
  }
  else {
    return '';
  }
}