You are here

public function EntityReferenceBrowserTableWidget::getFirstColumn in Entity Browser - Table Layout 8

Throws

\Drupal\Component\Plugin\Exception\PluginException

1 call to EntityReferenceBrowserTableWidget::getFirstColumn()
EntityReferenceBrowserTableWidget::buildTableRows in src/Plugin/Field/FieldWidget/EntityReferenceBrowserTableWidget.php

File

src/Plugin/Field/FieldWidget/EntityReferenceBrowserTableWidget.php, line 334

Class

EntityReferenceBrowserTableWidget
Plugin implementation of the 'entity_reference_browser_table_widget' widget.

Namespace

Drupal\entity_browser_table\Plugin\Field\FieldWidget

Code

public function getFirstColumn(EntityInterface $entity) : array {
  $value = $this
    ->getFieldWidgetDisplay()
    ->view($entity);
  if (is_string($value)) {
    if ($value == ' ') {
      $value = $this
        ->t('<i>No title set</i>');
    }
    $value = [
      '#markup' => $value,
    ];
  }
  return $value;
}