getDevice() публичный Метод

Method to get device name
public getDevice ( ) : string
Результат string
Пример #1
0
 /**
  * Method to determine the mobile device
  *
  * @param  string $mobile
  * @return string
  */
 public static function getDevice($mobile = null)
 {
     $session = Session::getInstance();
     if (null !== $mobile) {
         $force = $mobile;
         if ($force == 'clear') {
             unset($session->mobile);
         } else {
             $session->mobile = $force;
         }
     }
     if (!isset($session->mobile)) {
         $device = Mobile::getDevice();
         if (null !== $device) {
             $device = strtolower($device);
             if ($device == 'android' || $device == 'windows') {
                 $device .= Mobile::isTabletDevice() ? '-tablet' : '-phone';
             }
         }
     } else {
         $device = $session->mobile;
     }
     return $device;
 }