You are here

public function MobileDeviceDetectionExtenderPlugin::getDevices in Mobile Device Detection 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php \Drupal\mobile_device_detection\Plugin\views\display_extender\MobileDeviceDetectionExtenderPlugin::getDevices()
  2. 8 src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php \Drupal\mobile_device_detection\Plugin\views\display_extender\MobileDeviceDetectionExtenderPlugin::getDevices()

Get the selected devices for this display.

2 calls to MobileDeviceDetectionExtenderPlugin::getDevices()
MobileDeviceDetectionExtenderPlugin::buildOptionsForm in src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php
Provide a form to edit options for this plugin.
MobileDeviceDetectionExtenderPlugin::optionsSummary in src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php
Provide the default summary for options and category in the views UI.

File

src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php, line 104

Class

MobileDeviceDetectionExtenderPlugin
Default display extender plugin; does nothing.

Namespace

Drupal\mobile_device_detection\Plugin\views\display_extender

Code

public function getDevices() {
  $devices = isset($this->options['device_detection']) ? $this->options['device_detection'] : NULL;
  if ($devices && isset($devices['devices'])) {
    $devices = array_filter($devices['devices'], function ($var) {
      return $var != FALSE;
    });
  }
  return $devices;
}