You are here

public function DsFieldSource::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_ds/src/Plugin/UiPatterns/Source/DsFieldSource.php, line 54

Class

DsFieldSource
Defines Display Suite fields source plugin.

Namespace

Drupal\ui_patterns_ds\Plugin\UiPatterns\Source

Code

public function getSourceFields() {
  $sources = [];
  $fields = $this->dsManager
    ->getDefinitions();
  foreach ($fields as $field) {
    if (!$this
      ->getContextProperty('limit')) {
      $sources[] = $this
        ->getSourceField($field['id'], $field['title']);
    }
    elseif (in_array($field['id'], $this
      ->getContextProperty('limit'))) {
      $sources[] = $this
        ->getSourceField($field['id'], $field['title']);
    }
  }
  return $sources;
}