class DefaultParagraphsAddEvent in Default Paragraphs 8
Represents Paragraph Entity adding as default.
Hierarchy
- class \Drupal\default_paragraphs\Events\DefaultParagraphsAddEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of DefaultParagraphsAddEvent
1 file declares its use of DefaultParagraphsAddEvent
- DefaultParagraphsWidget.php in src/
Plugin/ Field/ FieldWidget/ DefaultParagraphsWidget.php
File
- src/
Events/ DefaultParagraphsAddEvent.php, line 11
Namespace
Drupal\default_paragraphs\EventsView source
class DefaultParagraphsAddEvent extends Event {
/**
* The paragraph entity being added.
*
* @var \Drupal\paragraphs\ParagraphInterface
*/
protected $paragraphEntity;
/**
* The bundle of the paragraph entity.
*
* @var string
*/
private $targetBundle;
/**
* DefaultParagraphsAddEvent constructor.
*
* @param \Drupal\paragraphs\ParagraphInterface $paragraph_entity
* The paragraph entity being created.
* @param string $target_bundle
* The bundle, which the paragraph is referenced to.
*/
public function __construct(ParagraphInterface $paragraph_entity, $target_bundle) {
$this->paragraphEntity = $paragraph_entity;
$this->targetBundle = $target_bundle;
}
/**
* Get the paragraph entity.
*
* @return \Drupal\paragraphs\ParagraphInterface
* A paragraph entity.
*/
public function getParagraphEntity() {
return $this->paragraphEntity;
}
/**
* Get the paragraph's bundle.
*
* @return string
* A paragraph entity's bundle.
*/
public function getTargetBundle() {
return $this->targetBundle;
}
/**
* Set the paragraph entity.
*
* @param \Drupal\paragraphs\paragraphInterface $paragraph_entity
* The updated paragraph entity.
*/
public function setParagraphEntity(paragraphInterface $paragraph_entity) {
$this->paragraphEntity = $paragraph_entity;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultParagraphsAddEvent:: |
protected | property | The paragraph entity being added. | |
DefaultParagraphsAddEvent:: |
private | property | The bundle of the paragraph entity. | |
DefaultParagraphsAddEvent:: |
public | function | Get the paragraph entity. | |
DefaultParagraphsAddEvent:: |
public | function | Get the paragraph's bundle. | |
DefaultParagraphsAddEvent:: |
public | function | Set the paragraph entity. | |
DefaultParagraphsAddEvent:: |
public | function | DefaultParagraphsAddEvent constructor. |