You are here

public function WidgetManager::getWidgets in Fivestar 8

Returns an array of all widgets.

Return value

array An associative array of widgets and their info.

See also

hook_fivestar_widgets()

2 calls to WidgetManager::getWidgets()
WidgetManager::getWidgetInfo in src/WidgetManager.php
Returns a widget's info.
WidgetManager::getWidgetsOptionSet in src/WidgetManager.php
Returns an array of field options based on available widgets.

File

src/WidgetManager.php, line 37

Class

WidgetManager
Contains methods for managing votes.

Namespace

Drupal\fivestar

Code

public function getWidgets() {
  $widgets =& drupal_static(__FUNCTION__);
  if (isset($widgets)) {
    return $widgets;
  }
  $widgets = $this->moduleHandler
    ->invokeAll('fivestar_widgets');

  // Invoke hook_fivestar_widgets_alter() to allow all modules to alter the
  // discovered widgets.
  $this->moduleHandler
    ->alter('fivestar_widgets', $widgets);
  return $widgets;
}