You are here

protected static function ParagraphViewModeWidget::getParagraphsTypeFromRequest in Paragraph View Mode 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/ParagraphViewModeWidget.php \Drupal\paragraph_view_mode\Plugin\Field\FieldWidget\ParagraphViewModeWidget::getParagraphsTypeFromRequest()

Get ParagraphsType entity object from request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: Current request object.

Return value

\Drupal\paragraphs\Entity\ParagraphsType|null ParagraphsType entity.

2 calls to ParagraphViewModeWidget::getParagraphsTypeFromRequest()
ParagraphViewModeWidget::getAvailableViewModes in src/Plugin/Field/FieldWidget/ParagraphViewModeWidget.php
Getter for available view modes in paragraph entity type.
ParagraphViewModeWidget::getViewModesFieldDescription in src/Plugin/Field/FieldWidget/ParagraphViewModeWidget.php
Getter for 'view modes' field description.

File

src/Plugin/Field/FieldWidget/ParagraphViewModeWidget.php, line 205

Class

ParagraphViewModeWidget
Plugin implementation of the 'paragraph_view_mode' widget.

Namespace

Drupal\paragraph_view_mode\Plugin\Field\FieldWidget

Code

protected static function getParagraphsTypeFromRequest(Request $request) : ?ParagraphsType {
  return $request->attributes
    ->get('paragraphs_type', NULL);
}