trait ParagraphFormHelperTrait in Paragraphs Edit 8.2
Provides a helper for paragraph forms.
Hierarchy
- trait \Drupal\paragraphs_edit\ParagraphFormHelperTrait
3 files declare their use of ParagraphFormHelperTrait
- ParagraphCloneForm.php in src/
Form/ ParagraphCloneForm.php - ParagraphDeleteForm.php in src/
Form/ ParagraphDeleteForm.php - ParagraphEditForm.php in src/
Form/ ParagraphEditForm.php
File
- src/
ParagraphFormHelperTrait.php, line 11
Namespace
Drupal\paragraphs_editView source
trait ParagraphFormHelperTrait {
private $lineageInspector;
private $lineageRevisioner;
protected $rootParent;
/**
* Returns the lineage inspector service.
*
* @return \Drupal\paragraphs_edit\ParagraphLineageInspector
* The lineage inspector service data.
*/
protected function lineageInspector() {
if (!isset($this->lineageInspector)) {
$this->lineageInspector = \Drupal::service('paragraphs_edit.lineage.inspector');
}
return $this->lineageInspector;
}
/**
* Returns the lineage revisioner service.
*
* @return \Drupal\paragraphs_edit\ParagraphLineageRevisioner|null
* The lineage revisioner service data.
*/
protected function lineageRevisioner() {
if (!isset($this->lineageRevisioner)) {
$this->lineageRevisioner = \Drupal::service('paragraphs_edit.lineage.revisioner');
}
return $this->lineageRevisioner;
}
/**
* {@inheritdoc}
*
* Overridden to store the root parent entity.
*/
public function buildForm(array $form, FormStateInterface $form_state, EntityInterface $root_parent = NULL) {
$this->rootParent = $root_parent;
return parent::buildForm($form, $form_state);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ParagraphFormHelperTrait:: |
private | property | ||
ParagraphFormHelperTrait:: |
private | property | ||
ParagraphFormHelperTrait:: |
protected | property | ||
ParagraphFormHelperTrait:: |
public | function | Overridden to store the root parent entity. | |
ParagraphFormHelperTrait:: |
protected | function | Returns the lineage inspector service. | |
ParagraphFormHelperTrait:: |
protected | function | Returns the lineage revisioner service. |