public static function PrivateMessageThreadMemberFormatter::isApplicable in Private Message 8
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldFormatter/PrivateMessageThreadMemberFormatter.php \Drupal\private_message\Plugin\Field\FieldFormatter\PrivateMessageThreadMemberFormatter::isApplicable()
Returns if the formatter 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 formatter can be used, FALSE otherwise.
Overrides FormatterBase::isApplicable
File
- src/
Plugin/ Field/ FieldFormatter/ PrivateMessageThreadMemberFormatter.php, line 102
Class
- PrivateMessageThreadMemberFormatter
- Defines the private message member field formatter.
Namespace
Drupal\private_message\Plugin\Field\FieldFormatterCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
return $field_definition
->getFieldStorageDefinition()
->getTargetEntityTypeId() == 'private_message_thread' && $field_definition
->getFieldStorageDefinition()
->getSetting('target_type') == 'user';
}