public static function RealisticDummyContentEnvironment::addFileToArray in Realistic Dummy Content 3.x
Same name and namespace in other branches
- 8.2 api/src/includes/RealisticDummyContentEnvironment.php \Drupal\realistic_dummy_content_api\includes\RealisticDummyContentEnvironment::addFileToArray()
- 7.2 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 293
Class
- RealisticDummyContentEnvironment
- The abstract base environment.
Namespace
Drupal\realistic_dummy_content_api\includesCode
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;
}
}