protected function prepareFiles($files) {
    $values = [];

    foreach ($files as $file_uuid) {
      $file = $this->fileStorage->loadByProperties([
        'uuid' => $file_uuid,
      ]);

      if ($file) {
        $values[] = [
          'target_id' => current($file)->id(),
        ];
      }
    }

    return $values;
  }
protected function prepareFiles($files) {
    $values = [];

    foreach ($files as $file_uuid) {
      $file = $this->fileStorage->loadByProperties([
        'uuid' => $file_uuid,
      ]);

      if ($file) {
        $values[] = [
          'target_id' => current($file)->id(),
        ];
      }
    }

    return $values;
  }
protected function prepareFiles ( $ files ) { $ values = [ ] ; foreach ( $ files as $ file_uuid ) { $ file = $ this -> fileStorage -> loadByProperties ( [ 'uuid' => $ file_uuid , ] ) ; if ( $ file ) { $ values [ ] = [ 'target_id' => current ( $ file ) -> id ( ) , ] ; } } return $ values ; }
Prepares an array with list of files to set as field value.

@param string $files
The uuid for the file.

@return array
Returns an array.
Prepares an array with list of files to set as field value .