class ShortcutController

Builds the page for administering shortcut sets.

Hierarchy

Expanded class hierarchy of ShortcutController

File

drupal/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php, line 16
Contains \Drupal\shortcut\Controller\ShortCutController.

Namespace

Drupal\shortcut\Controller
View source
class ShortcutController implements ControllerInterface {

  /**
   * Stores the entity manager.
   *
   * @var \Drupal\Core\Entity\EntityManager
   */
  protected $entityManager;

  /**
   * Constructs a new \Drupal\shortcut\Controller\ShortCutController object.
   *
   * @param \Drupal\Core\Entity\EntityManager $entity_manager
   *   The entity manager.
   */
  public function __construct(EntityManager $entity_manager) {
    $this->entityManager = $entity_manager;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static($container
      ->get('plugin.manager.entity'));
  }

  /**
   * Presents a list of layouts.
   *
   * @return array
   *   An array as expected by drupal_render().
   */
  public function shortcutSetAdmin() {
    return $this->entityManager
      ->getListController('shortcut')
      ->render();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ShortcutController::$entityManager protected property Stores the entity manager.
ShortcutController::create public static function Instantiates a new instance of this controller. Overrides ControllerInterface::create
ShortcutController::shortcutSetAdmin public function Presents a list of layouts.
ShortcutController::__construct public function Constructs a new \Drupal\shortcut\Controller\ShortCutController object.