Issue #2723631 by pbuyle, John Cook, valthebald, Mile23: Remove entity_load* usage for tour entity type

8.2.x
Nathaniel Catchpole 2016-05-17 10:45:28 +01:00
parent 899cb5239b
commit 4bc14c7294
2 changed files with 3 additions and 2 deletions

View File

@ -145,7 +145,7 @@ class TourTest extends TourTestBasic {
$this->drupalGet('tour-test-1');
// Load it back from the database and verify storage worked.
$entity_save_tip = entity_load('tour', 'tour-entity-create-test-en');
$entity_save_tip = Tour::load('tour-entity-create-test-en');
// Verify that hook_ENTITY_TYPE_load() integration worked.
$this->assertEqual($entity_save_tip->loaded, 'Load hooks work');
// Verify that hook_ENTITY_TYPE_presave() integration worked.

View File

@ -6,6 +6,7 @@
*/
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\tour\Entity\Tour;
/**
* Implements hook_help().
@ -85,7 +86,7 @@ function tour_page_bottom(array &$page_bottom) {
$results = \Drupal::entityQuery('tour')
->condition('routes.*.route_name', $route_name)
->execute();
if (!empty($results) && $tours = entity_load_multiple('tour', array_keys($results))) {
if (!empty($results) && $tours = Tour::loadMultiple(array_keys($results))) {
foreach ($tours as $id => $tour) {
// Match on params.
if (!$tour->hasMatchingRoute($route_name, $route_match->getRawParameters()->all())) {