protected function parseUserAgent($userAgentString)
    {
        $parser = new WhichBrowser\Parser($userAgentString);

        if (!$parser->isDetected()) {
            return;
        }

        if ($parser->isType('mobile')) {
            $this->setType('mobile');
        } elseif ($parser->isType('tablet')) {
            $this->setType('tablet');
        } elseif ($parser->isType('desktop')) {
            $this->setType('pc');
        } else {
            $this->setType('other');
        }

        if ($parser->isOs('Android')) {
            $this->setOperatingSystem('android');
        } elseif ($parser->isOs('iOS')) {
            $this->setOperatingSystem('ios');
        } elseif ($parser->isOs('Windows')) {
            $this->setOperatingSystem('windows');
        } elseif ($parser->isOs('Windows Phone')) {
            $this->setOperatingSystem('windows-mobile');
        } else {
            $this->setOperatingSystem('other');
        }
    }