ShortcutSet::getShortcuts

public 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

File

core/modules/shortcut/src/Entity/ShortcutSet.php, line 118

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;
}
doc_Drupal
2016-10-29 09:42:42
Comments
Leave a Comment

Please login to continue.