<?php
/**
 * This file is part of the WURFL implementation of the DDR Simple API and
 * defines an internal class used to represent a requesting device as a set
 * of {@link PropertyValue}.
 * 
 * @author Sylvain Lequeux
 * @author Francois Daoust <fd@w3.org>
 * @package AskPythia
 * @subpackage Implementation
 * @version $Revision: 1.15 $
 * @license http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231.html W3C Software Notice and License
 * @copyright Copyright (c) 2009, W3C (MIT, ERCIM, Keio)
 */

/**
 * Include the {@link BasicPropertyValues} class implementation.
 */
require_once(dirname(__FILE__).'/../basic/basicPropertyValues.php');

/**
 * Internal class used to represent a device in the WURFL repository. A Device
 * is an entity identified by a User-Agent that contains a list of property
 * values for the identified device.
 * 
 * The class does not implement any of the interfaces of the
 * {@link http://www.w3.org/TR/DDR-Simple-API/ DDR Simple API}. It is
 * a wrapper class that more or less follows the structure of the WURFL
 * database.
 * 
 * Note the class is used only for properties management. ID, vendors, and
 * fallback mechanisms are not used anymore (fallback is already integrated
 * in the patched WURFL database).
 * 
 * @author Sylvain Lequeux
 * @author Francois Daoust <fd@w3.org>
 * @package AskPythia
 * @subpackage Implementation
 * @link http://www.w3.org/TR/DDR-Simple-API/ Device Description Repository Simple API
 * @link http://wurfl.sourceforge.net/ WURFL
 * @version $Revision: 1.15 $
 * @license http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231.html W3C Software Notice and License
 * @copyright Copyright (c) 2009, W3C (MIT, ERCIM, Keio)
 */
class WURFLDevice {
	/**
	 * @var string User-Agent of the device. The User-Agent uniquely identifies the device.
	 * @access private
	 */
	private $userAgent;

	
	/**
	 * @var PropertyValues Known property values of the device.
	 * @access private
	 */
	private $propertyValues;

	
	/**
	 * Default constructor of a Device identified by the given User-Agent.
	 * 
	 * @param string $userAgent the User-Agent that identifies the device.
	 * @access public
	 */
	public function __construct($userAgent) {
		$this->userAgent = $userAgent;
		$this->propertyValues = new BasicPropertyValues();
	}
	
	
	/**
	 * Returns the User-Agent that identifies the device.
	 * 
	 * @return string the User-Agent that identifies the device.
	 * @access public
	 */
	public function getUserAgent() {
		return $this->userAgent;
	}
	
	
	/**
	 * Returns the list of properties of the device.
	 * 
	 * @return PropertyValues the list of known properties of the device.
	 * @access public
	 */
	public function getPropertyValues(){
		return $this->propertyValues;
	}
}
?>