You are here

protected function WidgetBase::isDefaultValueWidget in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Field/WidgetBase.php \Drupal\Core\Field\WidgetBase::isDefaultValueWidget()

Returns whether the widget used for default value form.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

bool TRUE if a widget used to input default value, FALSE otherwise.

3 calls to WidgetBase::isDefaultValueWidget()
CommentWidget::formElement in core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php
Returns the form for a single field widget.
LinkWidget::formElement in core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
Returns the form for a single field widget.
WidgetBase::formSingleElement in core/lib/Drupal/Core/Field/WidgetBase.php
Generates the form element for a single copy of the widget.

File

core/lib/Drupal/Core/Field/WidgetBase.php, line 568
Contains \Drupal\Core\Field\WidgetBase.

Class

WidgetBase
Base class for 'Field widget' plugin implementations.

Namespace

Drupal\Core\Field

Code

protected function isDefaultValueWidget(FormStateInterface $form_state) {
  return (bool) $form_state
    ->get('default_value_widget');
}