Paragraphs Editor
Main Page
Namespaces
Classes
Files
File List
DeliverWidgetBinderData.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Drupal\paragraphs_editor\Ajax
;
4
5
use
Drupal\Core\Ajax\CommandInterface
;
6
use
Drupal\paragraphs_editor\WidgetBinder\WidgetBinderData
;
7
8
/**
9
* Ajax command for delivering widget binder model collections to the client.
10
*/
11
class
DeliverWidgetBinderData
implements
CommandInterface {
12
13
/**
14
* The module name that will trigger the appropriate widget binder instance.
15
*
16
* @var string
17
*/
18
protected
$moduleName
;
19
20
/**
21
* The widget binder data models to be delivered.
22
*
23
* @var \Drupal\paragraphs_editor\WidgetBinder\WidgetBinderData
24
*/
25
protected
$data
;
26
27
/**
28
* Creates a DeliverWidgetBinderData command.
29
*
30
* @param string $module_name
31
* The module name implementing the editor integration.
32
* @param \Drupal\paragraphs_editor\WidgetBinder\WidgetBinderData $data
33
* The data collection to deliver.
34
*/
35
public
function
__construct
($module_name,
WidgetBinderData
$data
) {
36
$this->moduleName = $module_name;
37
$this->data =
$data
;
38
}
39
40
/**
41
* {@inheritdoc}
42
*/
43
public
function
render
() {
44
$command = [
45
'command'
=>
'paragraphs_editor_data'
,
46
'module'
=>
$this->moduleName
,
47
] + $this->data->toArray();
48
return
$command;
49
}
50
51
}
Drupal\paragraphs_editor\Ajax\DeliverWidgetBinderData\$moduleName
$moduleName
Definition:
DeliverWidgetBinderData.php:18
WidgetBinderData
Drupal\paragraphs_editor\Ajax\DeliverWidgetBinderData
Definition:
DeliverWidgetBinderData.php:11
Drupal\paragraphs_editor\Ajax\DeliverWidgetBinderData\__construct
__construct($module_name, WidgetBinderData $data)
Definition:
DeliverWidgetBinderData.php:35
Drupal\paragraphs_editor\Ajax
Definition:
CloseModalCommand.php:3
Drupal\paragraphs_editor\Ajax\DeliverWidgetBinderData\render
render()
Definition:
DeliverWidgetBinderData.php:43
Drupal\paragraphs_editor\Ajax\DeliverWidgetBinderData\$data
$data
Definition:
DeliverWidgetBinderData.php:25
CommandInterface
Drupal\paragraphs_editor\WidgetBinder\WidgetBinderData
Definition:
WidgetBinderData.php:13
src
Ajax
DeliverWidgetBinderData.php
Generated by
1.8.11