By plopesc on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.3.x
Introduced in version:
10.3.0
Issue links:
Description:
Functions have been moved to Drupal\shortcut\ShortcutSetStorage, and defined in Drupal\shortcut\ShortcutSetStorageInterface.
New method getDisplayedToUser() have been added to Drupal\shortcut\ShortcutSetStorage.
Before
<?php
$account = User::load(1);
$user_1_display_set = shortcut_current_displayed_set($account);
$current_user_display_set = shortcut_current_displayed_set();
$user_1_default_set = shortcut_default_set($account);
$current_user_default_set = shortcut_default_set();
After
<?php
$storage = \Drupal::entityTypeManager()->getStorage('shortcut_set');
$account = User::load(1);
$user_1_display_set = $storage->getDisplayedToUser(\Drupal::currentUser());
$current_user_display_set = $storage->getDisplayedToUser($account);
$user_1_default_set = $storage->getDefaultSet(\Drupal::currentUser());
$current_user_default_set = $storage->getDefaultSet($account);
Additionally:
- ShortcutLazyBuilders now require EntityTypeManagerInterface and AccountInterface as 2nd and 3rd constructor arguments
Impacts:
Module developers