Paragraphs Editor
Main Page
Namespaces
Classes
Files
File List
EditBufferItemFactoryInterface.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Drupal\paragraphs_editor\EditBuffer
;
4
5
use
Drupal\paragraphs_editor\EditorCommand\CommandContextInterface
;
6
7
/**
8
* Represents a factory for creating edit buffer items.
9
*/
10
interface
EditBufferItemFactoryInterface
{
11
12
/**
13
* Creates a buffer item within a context.
14
*
15
* This should never be called inside an access check. Only call this after
16
* context validation has completed successfully.
17
*
18
* @param \Drupal\paragraphs_editor\EditorCommand\CommandContextInterface $context
19
* The context for the editor instance.
20
* @param string $bundle_name
21
* The bundle name for the paragraph to be created.
22
*
23
* @return \Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface
24
* The newly created edit buffer item.
25
*/
26
public
function
createBufferItem
(
CommandContextInterface
$context, $bundle_name);
27
28
/**
29
* Retrieves a paragraph item from within a context buffer.
30
*
31
* This is safe to call within access checks since we verify that the buffer
32
* is set before using it. This will create the paragraph item in the buffer
33
* it does not already exist.
34
*
35
* @param \Drupal\paragraphs_editor\EditorCommand\CommandContextInterface $context
36
* The context for the editor instance.
37
* @param string $paragraph_uuid
38
* The uuid of the paragraph to retrieve.
39
*
40
* @return \Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface
41
* The newly created edit buffer item.
42
*/
43
public
function
getBufferItem
(
CommandContextInterface
$context, $paragraph_uuid);
44
45
/**
46
* Duplicates an edit buffer item.
47
*
48
* This duplicates the paragraph contained in the edit buffer item and creates
49
* a new edit buffer item to contain the duplicate paragraph.
50
*
51
* @param \Drupal\paragraphs_editor\EditorCommand\CommandContextInterface $context
52
* The context that will receive the newly created edit buffer item.
53
* @param \Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface $item
54
* The item to be duplicated.
55
*
56
* @return \Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface
57
* The newly created edit buffer item.
58
*/
59
public
function
duplicateBufferItem
(
CommandContextInterface
$context,
EditBufferItemInterface
$item);
60
61
}
Drupal\paragraphs_editor\EditBuffer
Definition:
EditBuffer.php:3
Drupal\paragraphs_editor\EditBuffer\EditBufferItemFactoryInterface\duplicateBufferItem
duplicateBufferItem(CommandContextInterface $context, EditBufferItemInterface $item)
Drupal\paragraphs_editor\EditorCommand\CommandContextInterface
Definition:
CommandContextInterface.php:18
CommandContextInterface
Drupal\paragraphs_editor\EditBuffer\EditBufferItemFactoryInterface
Definition:
EditBufferItemFactoryInterface.php:10
Drupal\paragraphs_editor\EditBuffer\EditBufferItemFactoryInterface\getBufferItem
getBufferItem(CommandContextInterface $context, $paragraph_uuid)
Drupal\paragraphs_editor\EditBuffer\EditBufferItemInterface
Definition:
EditBufferItemInterface.php:15
Drupal\paragraphs_editor\EditBuffer\EditBufferItemFactoryInterface\createBufferItem
createBufferItem(CommandContextInterface $context, $bundle_name)
src
EditBuffer
EditBufferItemFactoryInterface.php
Generated by
1.8.11