public function Data::getTranslatableFiles

Returns a list of translatable files.

Parameters

array $data: The data structure.

Return value

\Drupal\file\FileInterface[] List of files, keyed by flattened data item key.

File

src/Data.php, line 287

Class

Data
All data-related functions.

Namespace

Drupal\tmgmt

Code

public function getTranslatableFiles(array $data) : array {
  $files = [];
  foreach ($this
    ->flatten($data) as $key => $item) {
    if (isset($item['#file']) && !empty($item['#translate'])) {
      $files[$key] = File::load($item['#file']);
    }
  }
  return $files;
}