Paragraphs Editor
Main Page
Namespaces
Classes
Files
File List
WidgetBinderDataCompilerInterface.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Drupal\paragraphs_editor\WidgetBinder
;
4
5
use
Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface
;
6
use
Drupal\paragraphs_editor\EditorCommand\CommandContextInterface
;
7
8
/**
9
* An interface for widget binder data compilers.
10
*
11
* The widget binder takes an edit buffer item and compiles the associated
12
* models for that buffer item.
13
*/
14
interface
WidgetBinderDataCompilerInterface
{
15
16
/**
17
* Adds a widget binder data generator service.
18
*
19
* Generators added here will be run for each compile method call.
20
*
21
* @param \Drupal\paragraphs_editor\WidgetBinder\GeneratorInterface $generator
22
* The generator service to add.
23
*/
24
public
function
addGenerator
(
GeneratorInterface
$generator);
25
26
/**
27
* Compiles an edit buffer item into widget binder consumable data models.
28
*
29
* @param \Drupal\paragraphs_editor\EditorCommand\CommandContextInterface $context
30
* The context the edit buffer item belongs to.
31
* @param \Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface $item
32
* The edit buffer item to compile data for.
33
* @param string $view_mode
34
* The Drupal view mode name to render the entity using. Defaults to
35
* 'default'.
36
* @param string|null $langcode
37
* The language to render the entity using (optional).
38
*
39
* @return \Drupal\paragraphs_editor\WidgetBinder\WidgetBinderData
40
* The collection of widget binder data models to be delivered to the
41
* browser for consumption by the widget binder integration.
42
*/
43
public
function
compile
(
CommandContextInterface
$context,
EditBufferItemInterface
$item, $view_mode =
'default'
, $langcode = NULL);
44
45
}
EditBufferItemInterface
Drupal\paragraphs_editor\WidgetBinder\WidgetBinderDataCompilerInterface\compile
compile(CommandContextInterface $context, EditBufferItemInterface $item, $view_mode= 'default', $langcode=NULL)
Drupal\paragraphs_editor\EditorCommand\CommandContextInterface
Definition:
CommandContextInterface.php:18
CommandContextInterface
Drupal\paragraphs_editor\WidgetBinder\WidgetBinderDataCompilerInterface
Definition:
WidgetBinderDataCompilerInterface.php:14
Drupal\paragraphs_editor\WidgetBinder
Definition:
EditableField.php:3
Drupal\paragraphs_editor\WidgetBinder\GeneratorInterface
Definition:
GeneratorInterface.php:18
Drupal\paragraphs_editor\WidgetBinder\WidgetBinderDataCompilerInterface\addGenerator
addGenerator(GeneratorInterface $generator)
Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface
Definition:
EditBufferItemInterface.php:15
src
WidgetBinder
WidgetBinderDataCompilerInterface.php
Generated by
1.8.11