You are here

protected function ConditionalFieldsFormHelper::hasConditionalFields in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x src/ConditionalFieldsFormHelper.php \Drupal\conditional_fields\ConditionalFieldsFormHelper::hasConditionalFields()
1 call to ConditionalFieldsFormHelper::hasConditionalFields()
ConditionalFieldsFormHelper::afterBuild in src/ConditionalFieldsFormHelper.php
An after_build callback for forms with dependencies.

File

src/ConditionalFieldsFormHelper.php, line 230

Class

ConditionalFieldsFormHelper
Helper to interact with forms.

Namespace

Drupal\conditional_fields

Code

protected function hasConditionalFields() {

  // Dependencies data is attached in conditional_fields_element_after_build().
  if (empty($this->form['#conditional_fields'])) {
    return FALSE;
  }
  if (!method_exists($this->form_state
    ->getFormObject(), 'getFormDisplay')) {
    return FALSE;
  }
  return TRUE;
}