Commit 63b6ed23 authored by webchick's avatar webchick

Issue #2014031 by kgoel | DmitryDrozdik: Replace drupal_container() with...

Issue #2014031 by kgoel | DmitryDrozdik: Replace drupal_container() with Drupal::service() in the tour module.
parent 5572e7fd
......@@ -82,7 +82,7 @@ class Tour extends ConfigEntityBase implements TourInterface {
public function __construct(array $values, $entity_type) {
parent::__construct($values, $entity_type);
$this->tipsBag = new TipsBag(drupal_container()->get('plugin.manager.tour.tip'), $this->tips);
$this->tipsBag = new TipsBag(\Drupal::service('plugin.manager.tour.tip'), $this->tips);
}
/**
......
......@@ -72,7 +72,7 @@ function hook_tour_presave($entity) {
* The tour object being inserted.
*/
function hook_tour_insert($entity) {
drupal_container()->get('plugin.manager.tour.tip')->clearCachedDefinitions();
Drupal::service('plugin.manager.tour.tip')->clearCachedDefinitions();
cache('cache_tour')->deleteTags(array('tour_items'));
}
......@@ -83,6 +83,6 @@ function hook_tour_insert($entity) {
* The tour object being updated.
*/
function hook_tour_update($entity) {
drupal_container()->get('plugin.manager.tour.tip')->clearCachedDefinitions();
Drupal::service('plugin.manager.tour.tip')->clearCachedDefinitions();
cache('cache_tour')->deleteTags(array('tour_items'));
}
......@@ -116,7 +116,7 @@ function tour_preprocess_page(&$variables) {
// Load all of the items and match on path.
$tours = entity_load_multiple('tour');
$path_alias = drupal_strtolower(drupal_container()->get('path.alias_manager')->getPathAlias($path));
$path_alias = drupal_strtolower(Drupal::service('path.alias_manager')->getPathAlias($path));
foreach ($tours as $tour_id => $tour) {
// @todo Replace this with an entity query that does path matching when
// http://drupal.org/node/1918768 lands.
......@@ -135,12 +135,12 @@ function tour_preprocess_page(&$variables) {
* Implements hook_tour_insert().
*/
function tour_tour_insert($entity) {
drupal_container()->get('plugin.manager.tour.tip')->clearCachedDefinitions();
Drupal::service('plugin.manager.tour.tip')->clearCachedDefinitions();
}
/**
* Implements hook_tour_update().
*/
function tour_tour_update($entity) {
drupal_container()->get('plugin.manager.tour.tip')->clearCachedDefinitions();
Drupal::service('plugin.manager.tour.tip')->clearCachedDefinitions();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment