You are here

public function FormModeManager::hasActiveFormMode in Form mode manager 8

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

Determine if current entity_type has one bundle implement this mode.

Parameters

string $entity_type: The entity type id.

string $form_mode_id: Identifier of form mode prefixed by entity type id.

Return value

bool True if tasks does display at primary position.

Overrides FormModeManagerInterface::hasActiveFormMode

File

src/FormModeManager.php, line 262

Class

FormModeManager
FormDisplayManager service.

Namespace

Drupal\form_mode_manager

Code

public function hasActiveFormMode($entity_type, $form_mode_id) {
  $has_active = FALSE;
  $bundles = array_keys($this->entityTypeBundleInfo
    ->getBundleInfo($entity_type));
  foreach ($bundles as $bundle) {
    if (!$has_active) {
      $has_active = $this
        ->isActive($entity_type, $bundle, $form_mode_id);
    }
  }
  return $has_active;
}