Pull merge.
[yaffs-website] / web / core / modules / layout_builder / src / Form / UpdateBlockForm.php
1 <?php
2
3 namespace Drupal\layout_builder\Form;
4
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\layout_builder\SectionStorageInterface;
7
8 /**
9  * Provides a form to update a block.
10  *
11  * @internal
12  */
13 class UpdateBlockForm extends ConfigureBlockFormBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getFormId() {
19     return 'layout_builder_update_block';
20   }
21
22   /**
23    * Builds the block form.
24    *
25    * @param array $form
26    *   An associative array containing the structure of the form.
27    * @param \Drupal\Core\Form\FormStateInterface $form_state
28    *   The current state of the form.
29    * @param \Drupal\layout_builder\SectionStorageInterface $section_storage
30    *   The section storage being configured.
31    * @param int $delta
32    *   The delta of the section.
33    * @param string $region
34    *   The region of the block.
35    * @param string $uuid
36    *   The UUID of the block being updated.
37    *
38    * @return array
39    *   The form array.
40    */
41   public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
42     $component = $section_storage->getSection($delta)->getComponent($uuid);
43     return $this->doBuildForm($form, $form_state, $section_storage, $delta, $component);
44   }
45
46   /**
47    * {@inheritdoc}
48    */
49   protected function submitLabel() {
50     return $this->t('Update');
51   }
52
53 }