Paragraphs Editor
WidgetBinderDataCompilerInterface.php
Go to the documentation of this file.
1 <?php
2 
4 
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  */
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 }
compile(CommandContextInterface $context, EditBufferItemInterface $item, $view_mode= 'default', $langcode=NULL)