FML Update
This commit is contained in:
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class AddBuddy implements Element {
|
||||
class AddBuddy extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -20,7 +20,7 @@ class AddBuddy implements Element {
|
||||
* Create a new AddBuddy Element
|
||||
*
|
||||
* @param string $login (optional) Buddy login
|
||||
* @return \FML\ManiaCode\AddBuddy|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
return new static($login);
|
||||
@ -41,7 +41,7 @@ class AddBuddy implements Element {
|
||||
* Set the buddy login
|
||||
*
|
||||
* @param string $login Buddy login
|
||||
* @return \FML\ManiaCode\AddBuddy|static
|
||||
* @return static
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string)$login;
|
||||
@ -52,7 +52,7 @@ class AddBuddy implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
return $xmlElement;
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class AddFavorite implements Element {
|
||||
class AddFavorite extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -22,7 +22,7 @@ class AddFavorite implements Element {
|
||||
* Create a new AddFavorite object
|
||||
*
|
||||
* @param string $login (optional) Server login
|
||||
* @return \FML\ManiaCode\AddFavorite|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
return new static($login);
|
||||
@ -43,7 +43,7 @@ class AddFavorite implements Element {
|
||||
* Set the server login
|
||||
*
|
||||
* @param string $login Server login
|
||||
* @return \FML\ManiaCode\AddFavorite|static
|
||||
* @return static
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string)$login;
|
||||
@ -57,7 +57,7 @@ class AddFavorite implements Element {
|
||||
*
|
||||
* @param string $serverIp Server ip
|
||||
* @param int $serverPort Server port
|
||||
* @return \FML\ManiaCode\AddFavorite|static
|
||||
* @return static
|
||||
*/
|
||||
public function setIp($serverIp, $serverPort) {
|
||||
$this->serverIp = (string)$serverIp;
|
||||
@ -70,7 +70,7 @@ class AddFavorite implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if (is_null($this->serverIp)) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
|
@ -9,7 +9,11 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
interface Element {
|
||||
abstract class Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
protected $tagName = 'element';
|
||||
|
||||
/**
|
||||
* Render the ManiaCode Element
|
||||
@ -17,5 +21,8 @@ interface Element {
|
||||
* @param \DOMDocument $domDocument The DOMDocument for which the Element should be rendered
|
||||
* @return \DOMElement
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument);
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
return $xmlElement;
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class GetSkin implements Element {
|
||||
class GetSkin extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -24,7 +24,7 @@ class GetSkin implements Element {
|
||||
* @param string $name (optional) Skin name
|
||||
* @param string $file (optional) Skin file
|
||||
* @param string $url (optional) Skin url
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
return new static($name, $file, $url);
|
||||
@ -53,7 +53,7 @@ class GetSkin implements Element {
|
||||
* Set the name of the skin
|
||||
*
|
||||
* @param string $name Skin name
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -64,7 +64,7 @@ class GetSkin implements Element {
|
||||
* Set the file of the skin
|
||||
*
|
||||
* @param string $file Skin file
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -75,7 +75,7 @@ class GetSkin implements Element {
|
||||
* Set the url of the skin
|
||||
*
|
||||
* @param string $url Skin url
|
||||
* @return \FML\ManiaCode\GetSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -86,7 +86,7 @@ class GetSkin implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class Go_To implements Element {
|
||||
class Go_To extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -20,7 +20,7 @@ class Go_To implements Element {
|
||||
* Create a new Go_To object
|
||||
*
|
||||
* @param string $link (optional) Goto link
|
||||
* @return \FML\ManiaCode\Go_To|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($link = null) {
|
||||
return new static($link);
|
||||
@ -41,7 +41,7 @@ class Go_To implements Element {
|
||||
* Set link
|
||||
*
|
||||
* @param string $link Goto link
|
||||
* @return \FML\ManiaCode\Go_To|static
|
||||
* @return static
|
||||
*/
|
||||
public function setLink($link) {
|
||||
$this->link = (string)$link;
|
||||
@ -52,7 +52,7 @@ class Go_To implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$linkElement = $domDocument->createElement('link', $this->link);
|
||||
$xmlElement->appendChild($linkElement);
|
||||
return $xmlElement;
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class InstallMacroblock implements Element {
|
||||
class InstallMacroblock extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -23,7 +23,7 @@ class InstallMacroblock implements Element {
|
||||
*
|
||||
* @param string $name (optional) Macroblock name
|
||||
* @param string $url (optional) Macroblock url
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
return new static($name, $url);
|
||||
@ -52,7 +52,7 @@ class InstallMacroblock implements Element {
|
||||
* Set the name of the macroblock
|
||||
*
|
||||
* @param string $name Macroblock name
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -63,7 +63,7 @@ class InstallMacroblock implements Element {
|
||||
* Set the file of the macroblock
|
||||
*
|
||||
* @param string $file Macroblock file
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
* @return static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -74,7 +74,7 @@ class InstallMacroblock implements Element {
|
||||
* Set the url of the macroblock
|
||||
*
|
||||
* @param string $url Macroblock url
|
||||
* @return \FML\ManiaCode\InstallMacroblock|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -85,7 +85,7 @@ class InstallMacroblock implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class InstallMap implements Element {
|
||||
class InstallMap extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -22,7 +22,7 @@ class InstallMap implements Element {
|
||||
*
|
||||
* @param string $name (optional) Map name
|
||||
* @param string $url (optional) Map url
|
||||
* @return \FML\ManiaCode\InstallMap|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
return new static($name, $url);
|
||||
@ -47,7 +47,7 @@ class InstallMap implements Element {
|
||||
* Set the name of the map
|
||||
*
|
||||
* @param string $name Map name
|
||||
* @return \FML\ManiaCode\InstallMap|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -58,7 +58,7 @@ class InstallMap implements Element {
|
||||
* Set the url of the map
|
||||
*
|
||||
* @param string $url Map url
|
||||
* @return \FML\ManiaCode\InstallMap|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -69,7 +69,7 @@ class InstallMap implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class InstallPack implements Element {
|
||||
class InstallPack extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -24,7 +24,7 @@ class InstallPack implements Element {
|
||||
* @param string $name (optional) Pack name
|
||||
* @param string $file (optional) Pack file
|
||||
* @param string $url (optional) Pack url
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
return new static($name, $file, $url);
|
||||
@ -53,7 +53,7 @@ class InstallPack implements Element {
|
||||
* Set the name of the pack
|
||||
*
|
||||
* @param string $name Pack name
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -64,7 +64,7 @@ class InstallPack implements Element {
|
||||
* Set the file of the pack
|
||||
*
|
||||
* @param string $file Pack file
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
* @return static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -75,7 +75,7 @@ class InstallPack implements Element {
|
||||
* Set the url of the pack
|
||||
*
|
||||
* @param string $url Pack url
|
||||
* @return \FML\ManiaCode\InstallPack|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -86,7 +86,7 @@ class InstallPack implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class InstallReplay implements Element {
|
||||
class InstallReplay extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -22,7 +22,7 @@ class InstallReplay implements Element {
|
||||
*
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
* @return \FML\ManiaCode\InstallReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
return new static($name, $url);
|
||||
@ -47,7 +47,7 @@ class InstallReplay implements Element {
|
||||
* Set the name of the replay
|
||||
*
|
||||
* @param string $name Replay name
|
||||
* @return \FML\ManiaCode\InstallReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -58,7 +58,7 @@ class InstallReplay implements Element {
|
||||
* Set the url of the replay
|
||||
*
|
||||
* @param string $url Replay url
|
||||
* @return \FML\ManiaCode\InstallReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -69,7 +69,7 @@ class InstallReplay implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class InstallScript implements Element {
|
||||
class InstallScript extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -24,7 +24,7 @@ class InstallScript implements Element {
|
||||
* @param string $name (optional) Script name
|
||||
* @param string $file (optional) Script file
|
||||
* @param string $url (optional) Script url
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
return new static($name, $file, $url);
|
||||
@ -53,7 +53,7 @@ class InstallScript implements Element {
|
||||
* Set the name of the script
|
||||
*
|
||||
* @param string $name Script name
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -64,7 +64,7 @@ class InstallScript implements Element {
|
||||
* Set the file of the script
|
||||
*
|
||||
* @param string $file Script file
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
* @return static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -75,7 +75,7 @@ class InstallScript implements Element {
|
||||
* Set the url of the script
|
||||
*
|
||||
* @param string $url Script url
|
||||
* @return \FML\ManiaCode\InstallScript|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -86,7 +86,7 @@ class InstallScript implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class InstallSkin implements Element {
|
||||
class InstallSkin extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -24,7 +24,7 @@ class InstallSkin implements Element {
|
||||
* @param string $name (optional) Skin name
|
||||
* @param string $file (optional) Skin file
|
||||
* @param string $url (optional) Skin url
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $file = null, $url = null) {
|
||||
return new static($name, $file, $url);
|
||||
@ -53,7 +53,7 @@ class InstallSkin implements Element {
|
||||
* Set the name of the skin
|
||||
*
|
||||
* @param string $name Skin name
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -64,7 +64,7 @@ class InstallSkin implements Element {
|
||||
* Set the file of the skin
|
||||
*
|
||||
* @param string $file Skin file
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public function setFile($file) {
|
||||
$this->file = (string)$file;
|
||||
@ -75,7 +75,7 @@ class InstallSkin implements Element {
|
||||
* Set the url of the skin
|
||||
*
|
||||
* @param string $url Skin url
|
||||
* @return \FML\ManiaCode\InstallSkin|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -86,7 +86,7 @@ class InstallSkin implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$fileElement = $domDocument->createElement('file', $this->file);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class JoinServer implements Element {
|
||||
class JoinServer extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -22,7 +22,7 @@ class JoinServer implements Element {
|
||||
* Create a new JoinServer object
|
||||
*
|
||||
* @param string $login (optional) Server login
|
||||
* @return \FML\ManiaCode\JoinServer|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($login = null) {
|
||||
return new static($login);
|
||||
@ -43,7 +43,7 @@ class JoinServer implements Element {
|
||||
* Set the server login
|
||||
*
|
||||
* @param string $login Server login
|
||||
* @return \FML\ManiaCode\JoinServer|static
|
||||
* @return static
|
||||
*/
|
||||
public function setLogin($login) {
|
||||
$this->login = (string)$login;
|
||||
@ -57,7 +57,7 @@ class JoinServer implements Element {
|
||||
*
|
||||
* @param string $serverIp Server ip
|
||||
* @param int $serverPort Server port
|
||||
* @return \FML\ManiaCode\JoinServer|static
|
||||
* @return static
|
||||
*/
|
||||
public function setIp($serverIp, $serverPort) {
|
||||
$this->serverIp = (string)$serverIp;
|
||||
@ -70,7 +70,7 @@ class JoinServer implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
if (is_null($this->serverIp)) {
|
||||
$loginElement = $domDocument->createElement('login', $this->login);
|
||||
$xmlElement->appendChild($loginElement);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class PlayMap implements Element {
|
||||
class PlayMap extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -22,7 +22,7 @@ class PlayMap implements Element {
|
||||
*
|
||||
* @param string $name (optional) Map name
|
||||
* @param string $url (optional) Map url
|
||||
* @return \FML\ManiaCode\PlayMap|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
return new static($name, $url);
|
||||
@ -47,7 +47,7 @@ class PlayMap implements Element {
|
||||
* Set the name of the map
|
||||
*
|
||||
* @param string $name Map name
|
||||
* @return \FML\ManiaCode\PlayMap|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -58,7 +58,7 @@ class PlayMap implements Element {
|
||||
* Set the url of the map
|
||||
*
|
||||
* @param string $url Map url
|
||||
* @return \FML\ManiaCode\PlayMap|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -69,7 +69,7 @@ class PlayMap implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class PlayReplay implements Element {
|
||||
class PlayReplay extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -22,7 +22,7 @@ class PlayReplay implements Element {
|
||||
*
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
* @return \FML\ManiaCode\PlayReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
return new static($name, $url);
|
||||
@ -47,7 +47,7 @@ class PlayReplay implements Element {
|
||||
* Set the name of the replay
|
||||
*
|
||||
* @param string $name Replay name
|
||||
* @return \FML\ManiaCode\PlayReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -58,7 +58,7 @@ class PlayReplay implements Element {
|
||||
* Set the url of the replay
|
||||
*
|
||||
* @param string $url Replay url
|
||||
* @return \FML\ManiaCode\PlayReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -69,7 +69,7 @@ class PlayReplay implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class ShowMessage implements Element {
|
||||
class ShowMessage extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -20,7 +20,7 @@ class ShowMessage implements Element {
|
||||
* Create a new ShowMessage object
|
||||
*
|
||||
* @param string $message (optional) Message text
|
||||
* @return \FML\ManiaCode\ShowMessage|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($message = null) {
|
||||
return new static($message);
|
||||
@ -41,7 +41,7 @@ class ShowMessage implements Element {
|
||||
* Set the message text
|
||||
*
|
||||
* @param string $message Message text
|
||||
* @return \FML\ManiaCode\ShowMessage|static
|
||||
* @return static
|
||||
*/
|
||||
public function setMessage($message) {
|
||||
$this->message = (string)$message;
|
||||
@ -52,7 +52,7 @@ class ShowMessage implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$messageElement = $domDocument->createElement('message', $this->message);
|
||||
$xmlElement->appendChild($messageElement);
|
||||
return $xmlElement;
|
||||
|
@ -9,7 +9,7 @@ namespace FML\ManiaCode;
|
||||
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
|
||||
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
|
||||
*/
|
||||
class ViewReplay implements Element {
|
||||
class ViewReplay extends Element {
|
||||
/*
|
||||
* Protected properties
|
||||
*/
|
||||
@ -22,7 +22,7 @@ class ViewReplay implements Element {
|
||||
*
|
||||
* @param string $name (optional) Replay name
|
||||
* @param string $url (optional) Replay url
|
||||
* @return \FML\ManiaCode\ViewReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public static function create($name = null, $url = null) {
|
||||
return new static($name, $url);
|
||||
@ -47,7 +47,7 @@ class ViewReplay implements Element {
|
||||
* Set the name of the replay
|
||||
*
|
||||
* @param string $name Replay name
|
||||
* @return \FML\ManiaCode\ViewReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public function setName($name) {
|
||||
$this->name = (string)$name;
|
||||
@ -58,7 +58,7 @@ class ViewReplay implements Element {
|
||||
* Set the url of the replay
|
||||
*
|
||||
* @param string $url Replay url
|
||||
* @return \FML\ManiaCode\ViewReplay|static
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = (string)$url;
|
||||
@ -69,7 +69,7 @@ class ViewReplay implements Element {
|
||||
* @see \FML\ManiaCode\Element::render()
|
||||
*/
|
||||
public function render(\DOMDocument $domDocument) {
|
||||
$xmlElement = $domDocument->createElement($this->tagName);
|
||||
$xmlElement = parent::render($domDocument);
|
||||
$nameElement = $domDocument->createElement('name', $this->name);
|
||||
$xmlElement->appendChild($nameElement);
|
||||
$urlElement = $domDocument->createElement('url', $this->url);
|
||||
|
Reference in New Issue
Block a user