You are here

protected function WebformManagedFileBase::getFiles in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformManagedFileBase.php \Drupal\webform\Plugin\WebformElement\WebformManagedFileBase::getFiles()

Get files.

Parameters

array $element: An element.

array|mixed $value: A value.

array $options: An array of options.

Return value

array An associative array containing files.

1 call to WebformManagedFileBase::getFiles()
WebformManagedFileBase::getTargetEntities in src/Plugin/WebformElement/WebformManagedFileBase.php
Get referenced entities.

File

src/Plugin/WebformElement/WebformManagedFileBase.php, line 470

Class

WebformManagedFileBase
Provides a base class webform 'managed_file' elements.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function getFiles(array $element, $value, array $options = []) {
  if (empty($value)) {
    return [];
  }
  $fids = (array) $value;
  $this->entityTypeManager
    ->getStorage('file')
    ->resetCache($fids);
  return $this->entityTypeManager
    ->getStorage('file')
    ->loadMultiple($fids);
}