BlazyViewsFieldMedia.php in Blazy 8.2
File
src/Plugin/views/field/BlazyViewsFieldMedia.php
View source
<?php
namespace Drupal\blazy\Plugin\views\field;
use Drupal\views\ResultRow;
class BlazyViewsFieldMedia extends BlazyViewsFieldPluginBase {
public function render(ResultRow $values) {
$media = $values->_entity;
$data['settings'] = $this
->mergedViewsSettings();
$data['settings']['delta'] = $values->index;
$this->mergedSettings = $data['settings'];
return $this->blazyEntity
->build($data, $media, $media
->label());
}
public function getScopedFormElements() {
return [
'multimedia' => TRUE,
'view_mode' => 'default',
] + parent::getScopedFormElements();
}
}