Huge FML Update
This commit is contained in:
		@@ -2,8 +2,10 @@
 | 
			
		||||
 | 
			
		||||
namespace FML\Elements;
 | 
			
		||||
 | 
			
		||||
use FML\Types\Renderable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Class representing music
 | 
			
		||||
 * Music Element
 | 
			
		||||
 *
 | 
			
		||||
 * @author steeffeen
 | 
			
		||||
 */
 | 
			
		||||
@@ -11,18 +13,17 @@ class Music implements Renderable {
 | 
			
		||||
	/**
 | 
			
		||||
	 * Protected Properties
 | 
			
		||||
	 */
 | 
			
		||||
	protected $data = '';
 | 
			
		||||
	protected $tagName = 'music';
 | 
			
		||||
	protected $data = '';
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Set Data Url
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param string $data
 | 
			
		||||
	 *        	Media Url
 | 
			
		||||
	 * @param string $data Media Url
 | 
			
		||||
	 * @return \FML\Elements\Music
 | 
			
		||||
	 */
 | 
			
		||||
	public function setData($data) {
 | 
			
		||||
		$this->data = $data;
 | 
			
		||||
		$this->data = (string) $data;
 | 
			
		||||
		return $this;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -31,10 +32,10 @@ class Music implements Renderable {
 | 
			
		||||
	 * @see \FML\Renderable::render()
 | 
			
		||||
	 */
 | 
			
		||||
	public function render(\DOMDocument $domDocument) {
 | 
			
		||||
		$xml = $domDocument->createElement($this->tagName);
 | 
			
		||||
		$xmlElement = $domDocument->createElement($this->tagName);
 | 
			
		||||
		if ($this->data) {
 | 
			
		||||
			$xml->setAttribute('data', $this->data);
 | 
			
		||||
			$xmlElement->setAttribute('data', $this->data);
 | 
			
		||||
		}
 | 
			
		||||
		return $xml;
 | 
			
		||||
		return $xmlElement;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user