You are here

protected function ParagraphBlock::getContextEntity in Paragraph blocks 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Block/ParagraphBlock.php \Drupal\paragraph_blocks\Plugin\Block\ParagraphBlock::getContextEntity()
  2. 3.x src/Plugin/Block/ParagraphBlock.php \Drupal\paragraph_blocks\Plugin\Block\ParagraphBlock::getContextEntity()

Return the entity that contains the paragraph.

Return value

\Drupal\Core\Entity\EntityInterface Returns the entity that holds the paragraph field.

1 call to ParagraphBlock::getContextEntity()
ParagraphBlock::build in src/Plugin/Block/ParagraphBlock.php
Builds and returns the renderable array for this block plugin.

File

src/Plugin/Block/ParagraphBlock.php, line 146

Class

ParagraphBlock
Provides a block to a paragraph value on an entity.

Namespace

Drupal\paragraph_blocks\Plugin\Block

Code

protected function getContextEntity() {
  return $this
    ->getContextValue('entity');
}