You are here

protected function EntityField::resolveFormParents in Entity Field Condition 2.0.x

Resolve form parents array.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

Return value

array An array of the form parents.

1 call to EntityField::resolveFormParents()
EntityField::buildConfigurationForm in src/Plugin/Condition/EntityField.php
Form constructor.

File

src/Plugin/Condition/EntityField.php, line 576

Class

EntityField
Define the entity field condition base class.

Namespace

Drupal\entity_field_condition\Plugin\Condition

Code

protected function resolveFormParents(FormStateInterface $form_state) : array {
  $parents = [];
  if ($form_object = $form_state
    ->getFormObject()) {
    switch (get_class($form_object)) {
      case 'Drupal\\block\\BlockForm':
        $parents = [
          'visibility',
          $this
            ->getPluginId(),
        ];
        break;
      case 'Drupal\\block_visibility_groups\\Form\\ConditionAddForm':
        $parents = [
          'condition',
        ];
        break;
    }
  }
  return $parents;
}