You are here

protected function StateTransitionFormFormatter::supportsConfirmationForm in State Machine 8

Gets whether the target entity type supports the confirmation form.

Return value

bool Whether the target entity type supports the confirmation form.

3 calls to StateTransitionFormFormatter::supportsConfirmationForm()
StateTransitionFormFormatter::settingsForm in src/Plugin/Field/FieldFormatter/StateTransitionFormFormatter.php
Returns a form to configure settings for the formatter.
StateTransitionFormFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/StateTransitionFormFormatter.php
Returns a short summary for the current formatter settings.
StateTransitionFormFormatter::viewElements in src/Plugin/Field/FieldFormatter/StateTransitionFormFormatter.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/StateTransitionFormFormatter.php, line 210

Class

StateTransitionFormFormatter
Plugin implementation of the 'state_transition_form' formatter.

Namespace

Drupal\state_machine\Plugin\Field\FieldFormatter

Code

protected function supportsConfirmationForm() {

  // If no "state-transition-form" link template is defined, we can't
  // support the confirmation form/modal for applying state transitions.
  $entity_type = $this->entityTypeManager
    ->getDefinition($this->fieldDefinition
    ->getTargetEntityTypeId());
  return $entity_type
    ->hasLinkTemplate('state-transition-form');
}