You are here

public static function RealisticDummyContentEnvironment::addFileToArray in Realistic Dummy Content 7.2

Same name and namespace in other branches
  1. 8.2 api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::addFileToArray()
  2. 3.x api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::addFileToArray()

Adds a file to an array of file group parts.

1 call to RealisticDummyContentEnvironment::addFileToArray()
RealisticDummyContentEnvironment::implementSortCandidateFiles in api/src/includes/RealisticDummyContentEnvironment.php
Given a list of candidate files, sort them by names and parts.

File

api/src/includes/RealisticDummyContentEnvironment.php, line 305

Class

RealisticDummyContentEnvironment
The abstract base environment.

Namespace

Drupal\realistic_dummy_content_api\includes

Code

public static function addFileToArray(&$array, $name, $file) {
  $fileinfo = self::getFileParts($name);
  if (isset($fileinfo['attribute_name'])) {
    $array[$fileinfo['base']]['attributes'][$fileinfo['attribute_name']] = $file;
  }
  else {
    $array[$fileinfo['base']]['file'] = $file;
  }
}