You are here

public function GISController::editSitemap in Google Image Sitemap 8

Same name and namespace in other branches
  1. 2.0.x src/Controller/GISController.php \Drupal\google_image_sitemap\Controller\GISController::editSitemap()
  2. 1.0.x src/Controller/GISController.php \Drupal\google_image_sitemap\Controller\GISController::editSitemap()

Function to edit image sitemap.

1 string reference to 'GISController::editSitemap'
google_image_sitemap.routing.yml in ./google_image_sitemap.routing.yml
google_image_sitemap.routing.yml

File

src/Controller/GISController.php, line 165

Class

GISController
Default controller for the google_image_sitemap module.

Namespace

Drupal\google_image_sitemap\Controller

Code

public function editSitemap($sitemap_id) {
  $query = $this->db
    ->select('google_image_sitemap', 'g')
    ->fields('g', [
    'sid',
    'node_type',
    'license',
  ])
    ->condition('sid', $sitemap_id, '=');
  $result = $query
    ->execute()
    ->fetchObject();
  if (!empty($result)) {
    $form = \Drupal::formBuilder()
      ->getForm('Drupal\\google_image_sitemap\\Form\\GoogleImageSitemapCreateForm', $result);
    return $form;
  }
  else {
    throw new NotFoundHttpException();
  }
}