function FileItem::isDisplayed

Same name in other branches
  1. 9 core/modules/file/src/Plugin/Field/FieldType/FileItem.php \Drupal\file\Plugin\Field\FieldType\FileItem::isDisplayed()
  2. 8.9.x core/modules/file/src/Plugin/Field/FieldType/FileItem.php \Drupal\file\Plugin\Field\FieldType\FileItem::isDisplayed()
  3. 11.x 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 382

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.