Paragraphs Editor
FieldValueWrapperInterface.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
7 /**
8  * A wrapper for performing CRUD on a paragraphs editor paragraph field.
9  */
11 
12  /**
13  * Gets the markup stored in a paragraphs editor field.
14  *
15  * @return string
16  * The markup in the text paragraph.
17  */
18  public function getMarkup();
19 
20  /**
21  * Gets the text format for the markup stored in a paragraphs editor field.
22  *
23  * @return string
24  * The editor format id.
25  */
26  public function getFormat();
27 
28  /**
29  * Gets a list of all paragraphs in the paragraphs editor field.
30  *
31  * @return \Drupal\paragraphs\ParagraphInterface[]
32  * A list of all paragraph entities in the field including the text
33  * paragraph.
34  */
35  public function getEntities();
36 
37  /**
38  * Sets the markup stored in a paragraphs editor field.
39  *
40  * @param string $markup
41  * The markup to set.
42  */
43  public function setMarkup($markup);
44 
45  /**
46  * Sets the text format for the markup stored in a paragraphs editor field.
47  *
48  * @param string $format
49  * The format to use for storing markup.
50  */
51  public function setFormat($format);
52 
53  /**
54  * Gets the paragraph holding the text for the field.
55  *
56  * @return \Drupal\paragraphs\ParagraphInterface
57  * The paragraph containing the markup for the field.
58  */
59  public function getTextEntity();
60 
61  /**
62  * Gets a list of paragraph entities referenced in the text paragraph.
63  *
64  * @return \Drupal\paragraphs\ParagraphInterface[]
65  * An array of entities that are referenced in the text paragraph's content.
66  */
67  public function getReferencedEntities();
68 
69  /**
70  * Gets a list of paragraph entities referenced in the text paragraph.
71  *
72  * @param \Drupal\paragraphs\ParagraphInterface[] $entities
73  * The list of referenced entities to store in the field.
74  */
75  public function setReferencedEntities(array $entities);
76 
77  /**
78  * Adds a referenced entity to store in the field.
79  *
80  * @param \Drupal\paragraphs\ParagraphInterface $entity
81  * The paragraph entity to store a reference to.
82  */
83  public function addReferencedEntity(ParagraphInterface $entity);
84 
85 }