function EntityDisplayFormBase::getDisplayStatuses

Same name in other branches
  1. 8.9.x core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getDisplayStatuses()
  2. 10 core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getDisplayStatuses()
  3. 11.x core/modules/field_ui/src/Form/EntityDisplayFormBase.php \Drupal\field_ui\Form\EntityDisplayFormBase::getDisplayStatuses()

Returns form or view modes statuses for the bundle used by this form.

Return value

array An array of form or view mode statuses.

2 calls to EntityDisplayFormBase::getDisplayStatuses()
EntityDisplayFormBase::form in core/modules/field_ui/src/Form/EntityDisplayFormBase.php
Gets the actual form array to be built.
EntityDisplayFormBase::submitForm in core/modules/field_ui/src/Form/EntityDisplayFormBase.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form stateā€¦

File

core/modules/field_ui/src/Form/EntityDisplayFormBase.php, line 846

Class

EntityDisplayFormBase
Base class for EntityDisplay edit forms.

Namespace

Drupal\field_ui\Form

Code

protected function getDisplayStatuses() {
    $display_statuses = [];
    $displays = $this->getDisplays();
    foreach ($displays as $display) {
        $display_statuses[$display->get('mode')] = $display->status();
    }
    return $display_statuses;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.