src/Zend/Http/UserAgent.php
public function getDevice()
    {
        if (null !== $this->_device) {
            return $this->_device;
        }

        $userAgent = $this->getUserAgent();

        // search an existing identification in the session
        $storage = $this->getStorage($userAgent);

        if (!$storage->isEmpty()) {
            // If the user agent and features are already existing, the
            // Zend_Http_UserAgent object is serialized in the session
            $object = $storage->read();
            $this->unserialize($object);
        } else {
            // Otherwise, the identification is made and stored in the session.
            // Find the browser type:
            $this->setBrowserType($this->_matchUserAgent());
            $this->_createDevice();

            // put the result in storage:
            $this->getStorage($userAgent)
                 ->write($this->serialize());
        }

        // Mark the object as immutable
        $this->_immutable = true;

        // Return the device instance
        return $this->_device;
    }
public function getDevice()
    {
        if (null !== $this->_device) {
            return $this->_device;
        }

        $userAgent = $this->getUserAgent();

        // search an existing identification in the session
        $storage = $this->getStorage($userAgent);

        if (!$storage->isEmpty()) {
            // If the user agent and features are already existing, the
            // Zend_Http_UserAgent object is serialized in the session
            $object = $storage->read();
            $this->unserialize($object);
        } else {
            // Otherwise, the identification is made and stored in the session.
            // Find the browser type:
            $this->setBrowserType($this->_matchUserAgent());
            $this->_createDevice();

            // put the result in storage:
            $this->getStorage($userAgent)
                 ->write($this->serialize());
        }

        // Mark the object as immutable
        $this->_immutable = true;

        // Return the device instance
        return $this->_device;
    }
public function getDevice ( ) { if ( null !== $ this -> _device ) { return $ this -> _device ; } $ userAgent = $ this -> getUserAgent ( ) ; // search an existing identification in the session $ storage = $ this -> getStorage ( $ userAgent ) ; if ( ! $ storage -> isEmpty ( ) ) { // If the user agent and features are already existing, the // Zend_Http_UserAgent object is serialized in the session $ object = $ storage -> read ( ) ; $ this -> unserialize ( $ object ) ; } else { // Otherwise, the identification is made and stored in the session. // Find the browser type: $ this -> setBrowserType ( $ this -> _matchUserAgent ( ) ) ; $ this -> _createDevice ( ) ; // put the result in storage: $ this -> getStorage ( $ userAgent ) -> write ( $ this -> serialize ( ) ) ; } // Mark the object as immutable $ this -> _immutable = true ; // Return the device instance return $ this -> _device ; }
Returns the device object

This is the object that will contain the various discovered device
capabilities.

@return Zend_Http_UserAgent_Device $device
Returns the device object