public static function ProfileFormWidget::isApplicable in Profile 8
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/ ProfileFormWidget.php, line 319
Class
- ProfileFormWidget
- Plugin implementation of the 'profile_form' widget.
Namespace
Drupal\profile\Plugin\Field\FieldWidgetCode
public static function isApplicable(FieldDefinitionInterface $field_definition) {
$entity_type = $field_definition
->getTargetEntityTypeId();
return $entity_type == 'user' && $field_definition
->getSetting('target_type') == 'profile' && $field_definition
->isComputed();
}