public function GISController::editSitemap in Google Image Sitemap 8
Same name and namespace in other branches
- 2.0.x src/Controller/GISController.php \Drupal\google_image_sitemap\Controller\GISController::editSitemap()
- 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'
File
- src/
Controller/ GISController.php, line 165
Class
- GISController
- Default controller for the google_image_sitemap module.
Namespace
Drupal\google_image_sitemap\ControllerCode
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();
}
}