TrackManiaControl/application/core/FML/Elements/Music.php

42 lines
683 B
PHP
Raw Normal View History

<?php
namespace FML\Elements;
2014-01-12 00:51:46 +01:00
use FML\Types\Renderable;
/**
2014-01-12 00:51:46 +01:00
* Music Element
*
* @author steeffeen
*/
class Music implements Renderable {
/**
2013-12-31 02:55:19 +01:00
* Protected Properties
*/
protected $tagName = 'music';
2014-01-12 00:51:46 +01:00
protected $data = '';
/**
2013-12-31 02:55:19 +01:00
* Set Data Url
*
2014-01-12 00:51:46 +01:00
* @param string $data Media Url
* @return \FML\Elements\Music
*/
public function setData($data) {
2014-01-12 00:51:46 +01:00
$this->data = (string) $data;
return $this;
}
/**
*
* @see \FML\Renderable::render()
*/
public function render(\DOMDocument $domDocument) {
2014-01-12 00:51:46 +01:00
$xmlElement = $domDocument->createElement($this->tagName);
if ($this->data) {
2014-01-12 00:51:46 +01:00
$xmlElement->setAttribute('data', $this->data);
}
2014-01-12 00:51:46 +01:00
return $xmlElement;
}
}