<?php

/**
 * 
 * @author Peter Csubak (chuby)
 * @copyright Peter Csubak (chuby)
 * 
 * //Annotations:
 * @Table
 */
class Dvd extends Entity {
	
	/**
	 * @var string
	 * @Id(hashBy="<<title>><<category>><<releaseDate>>")
	 * @Attribute(type="md5")
	 */
	protected $ID;
	
	/**
	 * @var string
	 * @Attribute(type="string", length=20)
	 */
	protected $title;
	
	/**
	 * @var string
	 * @Attribute(type="string", length=15)
	 */
	protected $category;
	
	/**
	 * @var int
	 * @Attribute(type="int")
	 */
	protected $rentalPrice;
	
	/**
	 * @var DateTime
	 * @Attribute(type="date")
	 */
	protected $releaseDate;
	
	/**
	 * @var string
	 * @Attribute(type="string", length=50)
	 * @Nullable
	 */
	protected $staring;
	
	/**
	 * @var string
	 * @Attribute(type="md5")
	 * @Nullable
	 */
	protected $orderId;
	
	/** @XmlSchema */
	public $desktop;
	
	/** @XmlSchema */
	public $mobile;
	
	
	
	public $order = "Megrendel";
	
	
	public function __toString(){
		return $this->title;
	}
	
	public function __construct(){
		$this->desktop = "<dvd>".
							"<title>title</title>".
							"<category>category</category>".
							"<rentalprice>rentalPrice</rentalprice>".
							"<releasedate>releaseDate</releasedate>".
							"<staring>staring</staring>".
							"<orderid>orderId</orderid>".
						"</dvd>";
		
		$this->mobile = "<d>".
							"<t>title</t>".
						"</d>";
	}
	
}
?>