Interim commit.
[yaffs-website] / web / modules / contrib / migrate_tools / src / Form / MigrationEditForm.php
1 <?php
2
3 namespace Drupal\migrate_tools\Form;
4
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\Core\Url;
7
8 /**
9  * Class MigrationEditForm
10  *
11  * Provides the edit form for our Migration entity.
12  *
13  * @package Drupal\migrate_tools\Form
14  *
15  * @ingroup migrate_tools
16  */
17 class MigrationEditForm extends MigrationFormBase {
18
19   /**
20    * Returns the actions provided by this form.
21    *
22    * For the edit form, we only need to change the text of the submit button.
23    *
24    * @param array $form
25    *   An associative array containing the structure of the form.
26    * @param \Drupal\Core\Form\FormStateInterface $form_state
27    *   An associative array containing the current state of the form.
28    *
29    * @return array
30    *   An array of supported actions for the current entity form.
31    */
32   public function actions(array $form, FormStateInterface $form_state) {
33     $actions = parent::actions($form, $form_state);
34     $actions['submit']['#value'] = t('Update Migration');
35
36     return $actions;
37   }
38
39   /**
40    * @param \Drupal\Core\Url $url
41    *   The URL associated with an operation.
42    *
43    * @param $migration_group
44    *   The migration's parent group.
45    */
46   protected function addGroupParameter(Url $url, $migration_group) {
47     $route_parameters = $url->getRouteParameters() + array('migration_group' => $migration_group);
48     $url->setRouteParameters($route_parameters);
49   }
50
51 }