You are here

public function AudioFieldPluginBase::getAudioRenderInfo in AudioField 8

Get required rendering information from an entity.

Parameters

\Drupal\file\Plugin\Field\FieldType\FileItem|\Drupal\link\Plugin\Field\FieldType\LinkItem $item: Item for which we are getting render information.

Return value

object Render information for an item.

1 call to AudioFieldPluginBase::getAudioRenderInfo()
AudioFieldPluginBase::getItemRenderList in src/AudioFieldPluginBase.php
Used to format file entities for use in the twig themes.

File

src/AudioFieldPluginBase.php, line 516

Class

AudioFieldPluginBase
Base class for audiofield plugins. Includes global functions.

Namespace

Drupal\audiofield

Code

public function getAudioRenderInfo($item) {
  return (object) [
    'item' => $item,
    'description' => $this
      ->getAudioDescription($item),
    'url' => $this
      ->getAudioSource($item),
    'id' => $this
      ->getUniqueId($item),
    'filetype' => $this
      ->getFiletype($item),
  ];
}