You are here

public function FormModeManager::candidateToExclude in Form mode manager 8

Same name and namespace in other branches
  1. 8.2 src/FormModeManager.php \Drupal\form_mode_manager\FormModeManager::candidateToExclude()

Evaluate if current form_mode is candidate to be filtered or not.

Parameters

array $form_mode: A form mode definition.

string $entity_type_id: The entity type id.

Return value

bool True if form mode is candidate to be excluded or False if not.

Overrides FormModeManagerInterface::candidateToExclude

1 call to FormModeManager::candidateToExclude()
FormModeManager::filterExcludedFormModes in src/FormModeManager.php
Filter a form mode collection to exclude all desired form mode id.

File

src/FormModeManager.php, line 159

Class

FormModeManager
FormDisplayManager service.

Namespace

Drupal\form_mode_manager

Code

public function candidateToExclude(array $form_mode, $entity_type_id) {
  if ($this
    ->isValidFormMode($form_mode) && $entity_type_id === $form_mode['targetEntityType']) {
    return FALSE;
  }
  return TRUE;
}