You are here

public function ShortcutSet::getShortcuts in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/shortcut/src/Entity/ShortcutSet.php \Drupal\shortcut\Entity\ShortcutSet::getShortcuts()

Returns all the shortcuts from a shortcut set sorted correctly.

Return value

\Drupal\shortcut\ShortcutInterface[] An array of shortcut entities.

Overrides ShortcutSetInterface::getShortcuts

1 call to ShortcutSet::getShortcuts()
ShortcutSet::resetLinkWeights in core/modules/shortcut/src/Entity/ShortcutSet.php
Resets the link weights in a shortcut set to match their current order.

File

core/modules/shortcut/src/Entity/ShortcutSet.php, line 123
Contains \Drupal\shortcut\Entity\ShortcutSet.

Class

ShortcutSet
Defines the Shortcut set configuration entity.

Namespace

Drupal\shortcut\Entity

Code

public function getShortcuts() {
  $shortcuts = \Drupal::entityManager()
    ->getStorage('shortcut')
    ->loadByProperties(array(
    'shortcut_set' => $this
      ->id(),
  ));
  uasort($shortcuts, array(
    '\\Drupal\\shortcut\\Entity\\Shortcut',
    'sort',
  ));
  return $shortcuts;
}