class RefreshDirectoryTree in Media Directories 8
Same name and namespace in other branches
- 3.x modules/media_directories_ui/src/Ajax/RefreshDirectoryTree.php \Drupal\media_directories_ui\Ajax\RefreshDirectoryTree
- 2.x modules/media_directories_ui/src/Ajax/RefreshDirectoryTree.php \Drupal\media_directories_ui\Ajax\RefreshDirectoryTree
Class RefreshDirectoryTree.
Hierarchy
- class \Drupal\media_directories_ui\Ajax\RefreshDirectoryTree implements CommandInterface
Expanded class hierarchy of RefreshDirectoryTree
3 files declare their use of RefreshDirectoryTree
- AddMediaFormBase.php in modules/
media_directories_ui/ src/ Form/ AddMediaFormBase.php - DirectoryDeleteForm.php in modules/
media_directories_ui/ src/ Form/ DirectoryDeleteForm.php - MediaDirectoriesController.php in modules/
media_directories_ui/ src/ Controller/ MediaDirectoriesController.php
File
- modules/
media_directories_ui/ src/ Ajax/ RefreshDirectoryTree.php, line 10
Namespace
Drupal\media_directories_ui\AjaxView source
class RefreshDirectoryTree implements CommandInterface {
/**
* The selected directory.
*
* @var int
*/
protected $selectedDirectory;
/**
* Newly selected media entity ids.
*
* @var array
*/
protected $newlySelectedEntityIds;
/**
* RefreshDirectoryTree constructor.
*
* @param int $selected_directory
* The selected directory.
* @param array $newly_selected_entity_ids
* Newly selected media entity ids.
*/
public function __construct($selected_directory = MEDIA_DIRECTORY_ROOT, array $newly_selected_entity_ids = []) {
$this->selectedDirectory = $selected_directory;
$this->newlySelectedEntityIds = $newly_selected_entity_ids;
}
/**
* Implements \Drupal\Core\Ajax\CommandInterface:render().
*/
public function render() {
return [
'command' => 'refreshDirectoryTree',
'data' => [
'selected_directory' => isset($this->selectedDirectory) ? $this->selectedDirectory : MEDIA_DIRECTORY_ROOT,
'newly_selected_entity_ids' => $this->newlySelectedEntityIds,
],
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RefreshDirectoryTree:: |
protected | property | Newly selected media entity ids. | |
RefreshDirectoryTree:: |
protected | property | The selected directory. | |
RefreshDirectoryTree:: |
public | function |
Implements \Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface:: |
|
RefreshDirectoryTree:: |
public | function | RefreshDirectoryTree constructor. |