/**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $link = $form_state->getValues();
     $this->linkStorage->save($link);
     drupal_set_message(t('The custom link for %loc was saved.', array('%loc' => $link['loc'])));
     $form_state->setRedirect('xmlsitemap_custom.list');
 }
 protected function addSitemapLink(array $link = array())
 {
     $last_id =& drupal_static(__FUNCTION__, 1);
     $link += array('type' => 'testing', 'id' => $last_id, 'access' => 1, 'status' => 1);
     // Make the default path easier to read than a random string.
     $link += array('loc' => $link['type'] . '-' . $link['id']);
     $last_id = max($last_id, $link['id']) + 1;
     $this->linkStorage->save($link);
     return $link;
 }