Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5namespace Drupal\display_builder\Controller;
6
7use Drupal\Core\Render\HtmlResponse;
8use Drupal\display_builder\InstanceInterface;
9use Symfony\Component\HttpFoundation\Request;
10
11/**
12 * HTTP controller for the REST API.
13 */
14interface ApiControllerInterface {
15
16  /**
17   * Attach a component_id, a block_id, or an existing source, to the root.
18   *
19   * @param \Symfony\Component\HttpFoundation\Request $request
20   *   HTTP Request.
21   * @param \Drupal\display_builder\InstanceInterface $builder
22   *   Display builder instance.
23   *
24   * @return \Drupal\Core\Render\HtmlResponse
25   *   The HTML response.
26   */
27  public function attachToRoot(Request $request, InstanceInterface $builder): HtmlResponse;
28
29  /**
30   * Attach a component_id, a block_id, or an source, to a component slot.
31   *
32   * @param \Symfony\Component\HttpFoundation\Request $request
33   *   HTTP Request.
34   * @param \Drupal\display_builder\InstanceInterface $builder
35   *   Display builder instance.
36   * @param string $node_id
37   *   Node ID of the parent.
38   * @param string $slot
39   *   Slot.
40   *
41   * @return \Drupal\Core\Render\HtmlResponse
42   *   The HTML response.
43   */
44  public function attachToSlot(Request $request, InstanceInterface $builder, string $node_id, string $slot): HtmlResponse;
45
46  /**
47   * Open source's contextual islands.
48   *
49   * @param \Symfony\Component\HttpFoundation\Request $request
50   *   HTTP Request.
51   * @param \Drupal\display_builder\InstanceInterface $builder
52   *   Display builder instance.
53   * @param string $node_id
54   *   Node ID of the source.
55   *
56   * @return array
57   *   The render array response.
58   */
59  public function get(Request $request, InstanceInterface $builder, string $node_id): array;
60
61  /**
62   * Update source.
63   *
64   * @param \Symfony\Component\HttpFoundation\Request $request
65   *   HTTP Request.
66   * @param \Drupal\display_builder\InstanceInterface $builder
67   *   Display builder instance.
68   * @param string $node_id
69   *   Node ID of the source.
70   *
71   * @return array
72   *   The render array response.
73   */
74  public function update(Request $request, InstanceInterface $builder, string $node_id): array;
75
76  /**
77   * Update source's 3rd party settings.
78   *
79   * @param \Symfony\Component\HttpFoundation\Request $request
80   *   HTTP Request.
81   * @param \Drupal\display_builder\InstanceInterface $builder
82   *   Display builder instance.
83   * @param string $node_id
84   *   Node ID of the source.
85   * @param string $island_id
86   *   Island ID.
87   *
88   * @return \Drupal\Core\Render\HtmlResponse
89   *   The HTML response.
90   */
91  public function thirdPartySettingsUpdate(Request $request, InstanceInterface $builder, string $node_id, string $island_id): HtmlResponse;
92
93  /**
94   * Paste a source.
95   *
96   * @param \Symfony\Component\HttpFoundation\Request $request
97   *   HTTP Request.
98   * @param \Drupal\display_builder\InstanceInterface $builder
99   *   Display builder instance.
100   * @param string $node_id
101   *   Node ID of the source.
102   * @param string $parent_id
103   *   Parent ID.
104   * @param string $slot_id
105   *   Slot ID.
106   * @param string $slot_position
107   *   Slot position.
108   *
109   * @return \Drupal\Core\Render\HtmlResponse
110   *   The HTML response.
111   */
112  public function paste(Request $request, InstanceInterface $builder, string $node_id, string $parent_id, string $slot_id, string $slot_position): HtmlResponse;
113
114  /**
115   * Delete a source.
116   *
117   * @param \Symfony\Component\HttpFoundation\Request $request
118   *   HTTP Request.
119   * @param \Drupal\display_builder\InstanceInterface $builder
120   *   Display builder instance.
121   * @param string $node_id
122   *   Node ID of the source to delete.
123   *
124   * @return \Drupal\Core\Render\HtmlResponse
125   *   The HTML response.
126   */
127  public function delete(Request $request, InstanceInterface $builder, string $node_id): HtmlResponse;
128
129  /**
130   * Save a source as preset.
131   *
132   * @param \Symfony\Component\HttpFoundation\Request $request
133   *   HTTP Request.
134   * @param \Drupal\display_builder\InstanceInterface $builder
135   *   Display builder instance.
136   * @param string $node_id
137   *   Node ID of the source to save.
138   *
139   * @return \Drupal\Core\Render\HtmlResponse
140   *   The HTML response.
141   */
142  public function saveAsPreset(Request $request, InstanceInterface $builder, string $node_id): HtmlResponse;
143
144  /**
145   * Save display builder instance.
146   *
147   * @param \Symfony\Component\HttpFoundation\Request $request
148   *   HTTP Request.
149   * @param \Drupal\display_builder\InstanceInterface $builder
150   *   Display builder instance.
151   *
152   * @return \Drupal\Core\Render\HtmlResponse
153   *   The HTML response.
154   */
155  public function save(Request $request, InstanceInterface $builder): HtmlResponse;
156
157  /**
158   * Restore to last save.
159   *
160   * @param \Symfony\Component\HttpFoundation\Request $request
161   *   HTTP Request.
162   * @param \Drupal\display_builder\InstanceInterface $builder
163   *   Display builder instance.
164   *
165   * @return \Drupal\Core\Render\HtmlResponse
166   *   The HTML response.
167   */
168  public function restore(Request $request, InstanceInterface $builder): HtmlResponse;
169
170  /**
171   * Revert entity override to default display.
172   *
173   * @param \Symfony\Component\HttpFoundation\Request $request
174   *   HTTP Request.
175   * @param \Drupal\display_builder\InstanceInterface $builder
176   *   Display builder instance.
177   *
178   * @return \Drupal\Core\Render\HtmlResponse
179   *   The HTML response.
180   */
181  public function revert(Request $request, InstanceInterface $builder): HtmlResponse;
182
183  /**
184   * Move history to the last past state.
185   *
186   * @param \Symfony\Component\HttpFoundation\Request $request
187   *   HTTP Request.
188   * @param \Drupal\display_builder\InstanceInterface $builder
189   *   Display builder instance.
190   *
191   * @return \Drupal\Core\Render\HtmlResponse
192   *   The HTML response.
193   */
194  public function undo(Request $request, InstanceInterface $builder): HtmlResponse;
195
196  /**
197   * Move history to the first future state.
198   *
199   * @param \Symfony\Component\HttpFoundation\Request $request
200   *   HTTP Request.
201   * @param \Drupal\display_builder\InstanceInterface $builder
202   *   Display builder instance.
203   *
204   * @return \Drupal\Core\Render\HtmlResponse
205   *   The HTML response.
206   */
207  public function redo(Request $request, InstanceInterface $builder): HtmlResponse;
208
209  /**
210   * Clear history.
211   *
212   * @param \Symfony\Component\HttpFoundation\Request $request
213   *   HTTP Request.
214   * @param \Drupal\display_builder\InstanceInterface $builder
215   *   Display builder instance.
216   *
217   * @return \Drupal\Core\Render\HtmlResponse
218   *   The HTML response.
219   */
220  public function clear(Request $request, InstanceInterface $builder): HtmlResponse;
221
222}