/** * * * @param string $deviceID * @return array */ public function getFallBackListForDevice($deviceID) { $devices = $this->_deviceRepository->getDeviceHierarchy($deviceID); $fallBacks = array(); foreach ($devices as $device) { $fallBacks[] = $device->id; } return $fallBacks; }
/** * Wraps the model device with WURFL_Xml_ModelDevice. This function takes the * Device ID and returns the WURFL_CustomDevice with all capabilities. * * @param string $deviceID * @param WURFL_Request_GenericRequest|null $request * @return WURFL_CustomDevice */ private function getWrappedDevice($deviceID, $request = null) { $device = $this->_cacheProvider->load('DEV_' . $deviceID); if (empty($device)) { $modelDevices = $this->_deviceRepository->getDeviceHierarchy($deviceID); $device = new WURFL_CustomDevice($modelDevices, $request); $this->_cacheProvider->save('DEV_' . $deviceID, $device); } return $device; }
/** * Wraps the model device with WURFL_Xml_ModelDevice. This function takes the * Device ID and returns the WURFL_CustomDevice with all capabilities. * * @param string $deviceID * @param string $matchInfo * @return WURFL_CustomDevice */ private function getWrappedDevice($deviceID, $matchInfo = null) { $device = $this->_cacheProvider->load('DEV_' . $deviceID); if (empty($device)) { $modelDevices = $this->_deviceRepository->getDeviceHierarchy($deviceID); $device = new WURFL_CustomDevice($modelDevices, $matchInfo); $this->_cacheProvider->save('DEV_' . $deviceID, $device); } return $device; //return new WURFL_Device ( $modelDevice, new WURFL_CapabilitiesHolder ( $modelDevice, $this->_deviceRepository, $this->_cacheProvider ) ); }
/** * Wraps the model device with WURFL_Xml_ModelDevice. This function takes the * Device ID and returns the WURFL_CustomDevice with all capabilities. * * @param string $deviceID * @param WURFL_Request_GenericRequest|null $request * @return WURFL_CustomDevice */ private function getWrappedDevice($deviceID, $request = null) { $modelDevices = $this->_cacheProvider->load('DEVS_' . $deviceID); if (empty($modelDevices)) { $modelDevices = $this->_deviceRepository->getDeviceHierarchy($deviceID); } $this->_cacheProvider->save('DEVS_' . $deviceID, $modelDevices); if ($request === null) { // If a request was not provided, we generate one from the WURFL entry itself // to help resolve the virtual capabilities $requestFactory = new WURFL_Request_GenericRequestFactory(); $request = $requestFactory->createRequestForUserAgent($modelDevices[0]->userAgent); $genericNormalizer = WURFL_UserAgentHandlerChainFactory::createGenericNormalizers(); $request->userAgentNormalized = $genericNormalizer->normalize($request->userAgent); } // The CustomDevice is not cached since virtual capabilities must be recalculated // for every different request. return new WURFL_CustomDevice($modelDevices, $request); }
/** * Returns all the capabilities value of the current device as <capabilityName, capabilityValue> * @return array All capabilities */ public function getAllCapabilities() { return $this->_deviceRepository->getAllCapabilitiesForDevice($this->_device->id); }
/** * Wraps the model device with WURFL_Xml_ModelDevice * * @param string $deviceID * @return WURFL_CustomDevice */ private function getWrappedDevice($deviceID) { $modelDevices = $this->_deviceRepository->getDeviceHierarchy($deviceID); return new WURFL_CustomDevice($modelDevices); //return new WURFL_Device ( $modelDevice, new WURFL_CapabilitiesHolder ( $modelDevice, $this->_deviceRepository, $this->_cacheProvider ) ); }