You are here

public function UnmanagedFilesService::setChosenDirs in Fancy File Delete 2.0.x

Set a list of chosen directories from which to delete unmanaged files from.

Parameters

array $chosen_dirs:

File

src/UnmanagedFilesService.php, line 140

Class

UnmanagedFilesService
Class UnmanagedFilesService.

Namespace

Drupal\fancy_file_delete

Code

public function setChosenDirs(array $chosen_dirs) {

  // Only include directories that currently exist.
  $all_dirs = $this
    ->getDirs();
  $chosen_dirs = array_intersect($all_dirs, $chosen_dirs);
  natsort($chosen_dirs);
  $this->state
    ->set('fancy_file_delete_unmanaged_chosen_dirs', array_values($chosen_dirs));
}