public static function ModerationStateWidget::isApplicable in Drupal 9
Same name and namespace in other branches
- 8 core/modules/content_moderation/src/Plugin/Field/FieldWidget/ModerationStateWidget.php \Drupal\content_moderation\Plugin\Field\FieldWidget\ModerationStateWidget::isApplicable()
Returns if the widget can be used for the provided field.
Parameters
\Drupal\Core\Field\FieldDefinitionInterface $field_definition: The field definition that should be checked.
Return value
bool TRUE if the widget can be used, FALSE otherwise.
Overrides WidgetBase::isApplicable
1 call to ModerationStateWidget::isApplicable()
- ModerationStateWidgetTest::testIsApplicable in core/
modules/ content_moderation/ tests/ src/ Kernel/ ModerationStateWidgetTest.php - @covers ::isApplicable
File
- core/
modules/ content_moderation/ src/ Plugin/ Field/ FieldWidget/ ModerationStateWidget.php, line 193
Class
- ModerationStateWidget
- Plugin implementation of the 'moderation_state_default' widget.
Namespace
Drupal\content_moderation\Plugin\Field\FieldWidgetCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return is_a($field_definition
->getClass(), ModerationStateFieldItemList::class, TRUE);
}