public function PoolLabel::render in CMS Content Sync 2.0.x
Same name and namespace in other branches
- 8 modules/cms_content_sync_views/src/Plugin/views/field/PoolLabel.php \Drupal\cms_content_sync_views\Plugin\views\field\PoolLabel::render()
- 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\fieldCode
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 '';
}
}