calculateEntityBulkFormKey example

$entity = $this->getEntity($row);
        if ($entity !== NULL) {
          $entity = $this->getEntityTranslationByRelationship($entity$row);

          $form[$this->options['id']][$row_index] = [
            '#type' => 'checkbox',
            // We are not able to determine a main "title" for each row, so we             // can only output a generic label.             '#title' => $this->t('Update this item'),
            '#title_display' => 'invisible',
            '#default_value' => !empty($form_state->getValue($this->options['id'])[$row_index]) ? 1 : NULL,
            '#return_value' => $this->calculateEntityBulkFormKey($entity$use_revision),
          ];
        }
        else {
          $form[$this->options['id']][$row_index] = [];
        }

      }

      // Replace the form submit button label.       $form['actions']['submit']['#value'] = $this->t('Apply to selected items');

      
Home | Imprint | This part of the site doesn't use cookies.