You are here

private function MobileDeviceDetectionObject::_version in Mobile Device Detection 8

2 calls to MobileDeviceDetectionObject::_version()
MobileDeviceDetectionObject::getBrowser in src/Object/MobileDeviceDetectionObject.php
MobileDeviceDetectionObject::getOperatingSystem in src/Object/MobileDeviceDetectionObject.php

File

src/Object/MobileDeviceDetectionObject.php, line 246

Class

MobileDeviceDetectionObject

Namespace

Drupal\mobile_device_detection\Object

Code

private function _version($name) {
  $properties = (array) $this
    ->getAttributes()
    ->get('properties')[$name];
  foreach ($properties as $value) {
    $pattern = str_replace('[VER]', $this
      ->getAttributes()
      ->get('VER'), $value);
    preg_match(sprintf('#%s#is', $pattern), $this
      ->getUserAgentHeaders(), $matches);
    if (!empty($matches)) {
      $this->object->{$name}[] = $matches;
    }
  }
}