You are here

function sitemap_book_title_update in Sitemap 2.0.x

Same name and namespace in other branches
  1. 8.2 sitemap.install \sitemap_book_title_update()

Helper function to get a book title for the 2.x settings update.

Parameters

int $bid:

boolean $show_title:

Return value

string

1 call to sitemap_book_title_update()
sitemap_update_8200 in ./sitemap.install
Update configuration for 2.x.

File

./sitemap.install, line 148
Installation functions for Sitemap module.

Code

function sitemap_book_title_update($bid, $show_title) {
  if (!$show_title) {
    return '';
  }
  else {
    $book = \Drupal::service('entity_type.manager')
      ->getStorage('node')
      ->load($bid);
    if ($book) {
      return $book
        ->label();
    }
  }
}