You are here

public static function PrivateMessageThreadMemberWidget::isApplicable in Private Message 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldWidget/PrivateMessageThreadMemberWidget.php \Drupal\private_message\Plugin\Field\FieldWidget\PrivateMessageThreadMemberWidget::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

File

src/Plugin/Field/FieldWidget/PrivateMessageThreadMemberWidget.php, line 107

Class

PrivateMessageThreadMemberWidget
Defines the private message thread member widget.

Namespace

Drupal\private_message\Plugin\Field\FieldWidget

Code

public static function isApplicable(FieldDefinitionInterface $field_definition) {
  return $field_definition
    ->getFieldStorageDefinition()
    ->getTargetEntityTypeId() == 'private_message_thread' && $field_definition
    ->getFieldStorageDefinition()
    ->getSetting('target_type') == 'user';
}