You are here

public function FileItem::isDisplayed in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/file/src/Plugin/Field/FieldType/FileItem.php \Drupal\file\Plugin\Field\FieldType\FileItem::isDisplayed()

Determines whether an item should be displayed when rendering the field.

Return value

bool TRUE if the item should be displayed, FALSE if not.

1 method overrides FileItem::isDisplayed()
ImageItem::isDisplayed in core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
Determines whether an item should be displayed when rendering the field.

File

core/modules/file/src/Plugin/Field/FieldType/FileItem.php, line 350

Class

FileItem
Plugin implementation of the 'file' field type.

Namespace

Drupal\file\Plugin\Field\FieldType

Code

public function isDisplayed() {
  if ($this
    ->getSetting('display_field')) {
    return (bool) $this->display;
  }
  return TRUE;
}