You are here

protected function JwplayerFormatter::loadPreset in JW Player 8

Loads the configured preset.

@returns \Drupal\jw_player\Entity\Jw_player The preset specified in the formatter settings.

3 calls to JwplayerFormatter::loadPreset()
JwplayerFormatter::calculateDependencies in src/Plugin/Field/FieldFormatter/JwplayerFormatter.php
Calculates dependencies for the configured plugin.
JwplayerFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/JwplayerFormatter.php
Returns a short summary for the current formatter settings.
JwplayerFormatter::viewElements in src/Plugin/Field/FieldFormatter/JwplayerFormatter.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/JwplayerFormatter.php, line 279

Class

JwplayerFormatter
Plugin implementation of the 'foo_formatter' formatter.

Namespace

Drupal\jw_player\Plugin\Field\FieldFormatter

Code

protected function loadPreset() {
  if ($id = $this
    ->getSetting('jwplayer_preset')) {
    return Jw_player::load($id);
  }
  return NULL;
}