You are here

protected function BlocktabsEditForm::updateTabWeights in Block Tabs 8

Updates tab weights.

Parameters

array $tabs: Associative array with tabs having tab uuid as keys and array with tab data as values.

1 call to BlocktabsEditForm::updateTabWeights()
BlocktabsEditForm::submitForm in src/Form/BlocktabsEditForm.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

src/Form/BlocktabsEditForm.php, line 265

Class

BlocktabsEditForm
Controller for blocktabs edit form.

Namespace

Drupal\blocktabs\Form

Code

protected function updateTabWeights(array $tabs) {
  foreach ($tabs as $uuid => $tab_data) {
    if ($this->entity
      ->getTabs()
      ->has($uuid)) {
      $this->entity
        ->getTab($uuid)
        ->setWeight($tab_data['weight']);
    }
  }
}