You are here

public static function BlazyViews::viewsField in Blazy 8

Same name and namespace in other branches
  1. 8.2 src/BlazyViews.php \Drupal\blazy\BlazyViews::viewsField()

Returns one of the Blazy Views fields, if available.

3 calls to BlazyViews::viewsField()
BlazyManager::isBlazy in src/BlazyManager.php
Checks for Blazy formatter such as from within a Views style plugin.
BlazyViews::viewsPreRender in src/BlazyViews.php
Implements hook_views_pre_render().
BlazyViewsFileTest::todoTestBlazyViews in tests/src/Kernel/Views/BlazyViewsFileTest.php
Make sure that the HTML list style markup is correct.

File

src/BlazyViews.php, line 43

Class

BlazyViews
Provides optional Views integration.

Namespace

Drupal\blazy

Code

public static function viewsField($view) {
  foreach ([
    'file',
    'media',
  ] as $entity) {
    if (isset($view->field['blazy_' . $entity])) {
      return $view->field['blazy_' . $entity];
    }
  }
  return FALSE;
}