<?php

/**
 * Render and cache the LDB Block using the Journey Smart module.
 */
function _twmr_misc_render_contextual_ldb_block() {
  $block_manager = \Drupal::service('plugin.manager.block');
  $plugin_block = $block_manager->createInstance('journey_smart_live_times_contextual_block');
  if (!$plugin_block) {
    return NULL;
  }
  $ldb_block_render = $plugin_block->build();
  if (!$ldb_block_render) {
    return NULL;
  }
  \Drupal::service('renderer')->addCacheableDependency($ldb_block_render, $plugin_block);
  return $ldb_block_render;
}
