public function ParentEntity::render in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x modules/cms_content_sync_views/src/Plugin/views/field/ParentEntity.php \Drupal\cms_content_sync_views\Plugin\views\field\ParentEntity::render()
- 2.0.x modules/cms_content_sync_views/src/Plugin/views/field/ParentEntity.php \Drupal\cms_content_sync_views\Plugin\views\field\ParentEntity::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/ ParentEntity.php, line 50
Class
- ParentEntity
- Views Field handler for the flow label.
Namespace
Drupal\cms_content_sync_views\Plugin\views\fieldCode
public function render(ResultRow $values) {
$result = [];
/**
* @var \Drupal\cms_content_sync\Entity\EntityStatus $entity
*/
$entity = $values->_entity;
$source = $entity
->getEntity();
if ($source) {
// Ignored: node, block_content.
// @todo .
switch ($source
->getEntityTypeId()) {
// Custom.
case 'field_collection_item':
case 'menu_link_content':
case 'brick':
case 'file':
// Default.
case 'paragraph':
case 'media':
case 'taxonomy_term':
break;
}
}
if (empty($result)) {
return '-';
}
$html = '<ul>';
foreach ($result as $markup) {
$html .= $markup
->render();
}
$html .= '</ul>';
return Markup::create($html);
}