WURFL
[ class tree: WURFL ] [ index: WURFL ] [ all elements ]

Class: WURFL_WURFLManager

Source Location: /WURFLManager.php

Class Overview


WURFL Manager Class - serves as the core class that the developer uses to query the API for device capabilities and WURFL information


Author(s):

Methods



Class Details

[line 38]
WURFL Manager Class - serves as the core class that the developer uses to query the API for device capabilities and WURFL information

Examples:

  1.  // Example 1. Instantiate Manager from Factory:
  2.  $wurflManager $wurflManagerFactory->create();
  3.  
  4.  // Example 2: Get Visiting Device from HTTP Request
  5.  $device $wurflManager->getDeviceForHttpRequest($_SERVER);
  6.  
  7.  // Example 3: Get Visiting Device from User Agent
  8.  $userAgent 'Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10';
  9.  $device $wurflManager->getDeviceForUserAgent($userAgent);




Tags:



[ Top ]


Class Methods


constructor __construct [line 54]

WURFL_WURFLManager __construct( WURFL_WURFLService $wurflService, WURFL_Request_GenericRequestFactory $requestFactory)

Creates a new WURFL Manager object



Tags:

access:  public


Parameters:

WURFL_WURFLService   $wurflService  
WURFL_Request_GenericRequestFactory   $requestFactory  

[ Top ]

method getAllDevicesID [line 171]

array getAllDevicesID( )

Returns all the device ids in wurfl



Tags:

access:  public


[ Top ]

method getCapabilitiesNameForGroup [line 152]

array getCapabilitiesNameForGroup( string $groupID)

Returns all capability names for the given $groupID



Tags:

access:  public


Parameters:

string   $groupID  

[ Top ]

method getDevice [line 133]

WURFL_CustomDevice getDevice( string $deviceID)

Return a device for the given device id



Tags:

access:  public


Parameters:

string   $deviceID  

[ Top ]

method getDeviceForHttpRequest [line 103]

WURFL_CustomDevice getDeviceForHttpRequest( array $httpRequest)

Return a device for the given http request(user-agent..)



Tags:

return:  device
throws:  Exception if $httpRequest is not set
access:  public


Parameters:

array   $httpRequest   HTTP Request array (normally $_SERVER)

[ Top ]

method getDeviceForRequest [line 85]

WURFL_CustomDevice getDeviceForRequest( WURFL_Request_GenericRequest $request)

Return a device the given WURFL_Request_GenericRequest request(user-agent..)



Tags:

return:  device
throws:  Exception if the $request parameter is not set
access:  public


Parameters:

WURFL_Request_GenericRequest   $request  

[ Top ]

method getDeviceForUserAgent [line 118]

WURFL_CustomDevice getDeviceForUserAgent( string $userAgent)

Returns a device for the given user-agent



Tags:

return:  device
throws:  Exception if $userAgent is not set
access:  public


Parameters:

string   $userAgent  

[ Top ]

method getFallBackDevices [line 162]

array getFallBackDevices( string $deviceID)

Returns an array of all the fall back devices starting from the given device



Tags:

access:  public


Parameters:

string   $deviceID  

[ Top ]

method getListOfGroups [line 142]

array getListOfGroups( )

Returns an array of all wurfl group ids



Tags:

access:  public


[ Top ]

method getWURFLInfo [line 74]

WURFL_Xml_Info getWURFLInfo( )

Return the version info of the loaded wurfl xml file

Example:

  1.  $info $wurflManager->getWURFLInfo();
  2.  printf('Version: %s, Updated: %s, OfficialURL: %s',
  3.      $info->version,
  4.      $info->lastUpdated,
  5.      $info->officialURL
  6.  );




Tags:

return:  WURFL Version info
see:  WURFL_WURFLService::getWURFLInfo(), WURFL_DeviceRepository::getWURFLInfo()
access:  public


[ Top ]


Documentation generated on Fri, 30 Mar 2012 17:17:01 -0400 by phpDocumentor 1.4.4