You are here

public function ViewsRowSource::getSourceFields in UI Patterns 8

Return list of source fields.

Return value

\Drupal\ui_patterns\Definition\PatternSourceField[] List of source fields.

Overrides PatternSourceInterface::getSourceFields

File

modules/ui_patterns_views/src/Plugin/UiPatterns/Source/ViewsRowSource.php, line 24

Class

ViewsRowSource
Defines Views row pattern source plugin.

Namespace

Drupal\ui_patterns_views\Plugin\UiPatterns\Source

Code

public function getSourceFields() {
  $sources = [];

  /** @var \Drupal\views\ViewExecutable $view */
  $view = $this
    ->getContextProperty('view');
  foreach ($view->display_handler
    ->getFieldLabels() as $name => $label) {
    $sources[] = $this
      ->getSourceField($name, $label);
  }
  return $sources;
}