DeviceDetector\DeviceDetector::getDevice PHP Method

getDevice() public method

Returns the device type extracted from the parsed UA
See also: DeviceParserAbstract::$deviceTypes for available device types
public getDevice ( ) : integer | null
return integer | null
    public function getDevice()
    {
        return $this->device;
    }

Usage Example

 /**
  *
  * @param DeviceDetector $dd
  *
  * @return bool
  */
 private function hasResult(DeviceDetector $dd)
 {
     if ($dd->isBot() === true) {
         return true;
     }
     $client = $dd->getClient();
     if (isset($client['name']) && $this->isRealResult($client['name'])) {
         return true;
     }
     $os = $dd->getOs();
     if (isset($os['name']) && $this->isRealResult($os['name'])) {
         return true;
     }
     if ($dd->getDevice() !== null) {
         return true;
     }
     return false;
 }
All Usage Examples Of DeviceDetector\DeviceDetector::getDevice